Giter Site home page Giter Site logo

vlad-timotei / wpgp-tools Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 5.0 532 KB

A browser extension to help you translate faster and better on translate.w.org

License: GNU General Public License v3.0

CSS 9.90% JavaScript 89.55% HTML 0.56%
chrome-extension translation userscript

wpgp-tools's People

Contributors

nekojonez avatar vlad-timotei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wpgp-tools's Issues

When the tool finds "1 current" on a page, it should give a warning.

Various times, I find plugins that have more translated strings then current. Hunting these down is made easier with this extension and the history feature.
Now, I would find it quite handy if this tool gave some sort of warning (those triangle warnings maybe?) when there are 2 currents for a string.
That way you can find these

image

Even easier.

I left this one alone for testing this feature:

https://translate.wordpress.org/projects/wp-plugins/events-made-easy/stable/nl-be/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=12843760&sort%5Bby%5D=translation_date_added&sort%5Bhow%5D=desc&historypage

Edit: it could also give some sort of warning at the top where the numbers are to draw the attention that those numbers don't match...? I would only put a check there if the translated > all. Because if you display a warning when all > translated, you'd trigger a warning every not 100% translated plugin :P

HT: Fuzzy vs multiple Waiting comparation

In 1.4 History Tools compare a Fuzzy state string with only the latest Waiting state string, where as it is possible to have multiple Waiting state strings. (one-to-one comparation implementation)

To be included as a scenario in the one-to-many comparation implementation algorithm.

Build number for testing?

Would it be possible to show a build number eg in the settings that increases/changes with each commit?
The goal is for testers to know if they are on the latest build of the development.

Prevent save on any saving workflow

I have everything on "Warn & prevent save" in the options menu... Yet, if I save a string that doesn't have a . , ? , ! at the end and I save it with one... The tool doesn't stop me anymore. It does give a warning after saving, but it doesn't prevent.

Drop "Notify about these words" option

This option is mostly redundant, as user already has "Prevent saving these words" that generates a warning.
There is no need to generate a notification and not a warning if a certain word is "bad".
If it's a false positive result, then user can always check "Save / approve with warnings" or even remove the word from the list, if the percent of false positive results is too high

image

This gives the chance to keep a minimum number of options while implementing #14 (comment)

Tools or Tool settings?

I would like to have a small discussion. I was helping a new translator who installed WPGP and she said: "Why is it plural? Since, you are adjusting the settings of the WPGP Tools? And not adjusting the settings of multiple tools right?"

So, the menu item... Plural or singular?

Search in multiple plugins projects

Is it possible to specify several plugins here in "another plugin" selection?

image

Props: @fierevere & ru_RU PTEs 🙌🏻

Additional context: While it's not possible to add a wildcard/mask since there is no API for that, it's possible to make so that the field accepts multiple slugs.

An ending tab character in translation generates a wrong warning

A warning is given about a missing end period, but that is not correct the end period is present

The message is incorrect, as the endpoint is present. It is caused by the fact that a blank is behind the endpoint

MissingEndPeriod
MissingEndPeriod1
I think that the flow should be:
if additional blank present (warning)
if missing endpoint (warning)
Reporting the extra blank is also noted as issue for GlotPress

Other translation engine button

So, this extension adds a feature to go an see what Google Translate gives you. But something I like of the filler tool is that you can also use others like DeepL or Microsofts. Can a future version have an option to choose which translator you want to use?

Customize period check for some locales

For the same reason I provided on WP Meta Trac, the "missing period" error should be customized for some locales.

These are different variations of the period symbol that I know of.

  • Japanese and Chinese:
  • Hindi, Bengali, and Assamese:
  • Armenian: ։
  • Khmer:
  • Myanmar/Burmese:
  • Tibetan:
  • Urdu: ۔
  • Thai: no period

Bonus point if these can also be automatically sorted, but I'm happy simply if the check between "." and "。" is implemented 😝

But in Japanese, we use the English period when the string is not translated (e.g. "All Rights Reserved.". I can't confirm but I think this is the same for others. Happy to do more research once we decide on the direction!

Also, the ellipsis (...) at the end of a sentence tends to stay as-is for many locales (Japanese uses a native character for it, which is a single letter: ). There may be other exceptions like this.

Don't warn on missing double spaces

In the current version, missing double spaces is seen as a warning... Yet, this tool also warns you when you have double spaces in your translation.
So, I would have an "warn on double spaces" as an option. Since I think most locales want to avoid double spaces in their translations no?

The "warnings" feature should be able to scan for url mistakes.

The "warnings" feature can give us an easy way to quickly find mistakes and improve them... But what if this feature could also pick up mistakes in url translations?

I noticed that the fuzzy bot doesn't always fuzzy http:// to https:// changes (which is security wise an important change) and it would be neat if that could also appear in warnings...

(The http:// to https:// is just an example!)

Make going from one page to another easier

I think it could improve our workflow if we had:

  • Key combo to go to: the first page, the previous page, the next page and the last page in the project.
  • Have either a dropdown or a box where you can enter from which page you want to start. -> This would make it easier to "clean" projects (improving old translations.) If you left off on page 50 or something... It would save you some clicking / changing the url.

Bulk GTE replacement - Can't undo "Don't replace ..."

When you are setting up the bulk replacement for GTE's in the consistency tool, once you click "Don't translate..." you can't "unclick" it apart from refreshing the page.
I think it would be more user friendly if it's possible somehow. For example, by adding a sort of "undo" button?

If WPGPT is active then if the original has a lot of suggestions from TM, the content box is moved up to far

If WPGPT is active and a translation contains a lot of suggestions from TM or suggestions from consistency, the content box is moved up to far. After this you cannot read the original anymore, you need to scroll the content box down to see the original again.
If WPGPT is not active, then this is not happening.
Scrolling is fine, but the original should always be visible.
Below an example what I see happening
image

Refine placeholders count check for some locales

Reported by @naokomc

One thing I noticed, specific to Japanese and any others with nplurals = 1; (there are others according to
locales.php )

When we translate something like this,
https://translate.wordpress.org/projects/wp-plugins/mfs-slider/dev/ja/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=8910428&filters%5Btranslation_id%5D=87904071
We just need to translate it once using %s as the placeholder for any number, because nothing around the number changes no matter what the value is.

So in that case, Additional placeholder: %s error is not necessary for us here.

I hope that makes sense!

In another word, we can say something like “1 group” or “100 group” – the noun doesn’t change based on the number.

Additional context:
Currently, the comparison for all checks is being made between original (singular) and first translation form and original ( plural ) and next translation forms. This can be generally improved and in this case: if nplurals === 1 compare plural string with translation instead.

Wrong identification of the plugin/theme name

https://translate.wordpress.org/projects/wp-themes/construction-landing-page/nl-be/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=4808803&filters%5Btranslation_id%5D=93089810

When bulk replacing from the consistency tool... WPGP doesn't replaces strings likes this. As soon as "plugin name" is in the comment... It's blocked.
This is a double edged sword. It's a good idea to block it, since not every dev comments the same. BUT, then you have moments like this. Where the dev comments that a placeholder is the plugin name so nothing to worry about but WPGP stops you...

Maybe food for thought?

Tool doesn't tell you when a current already exists.

Currently, we have in waiting when another string is waiting OR when it has rejected ones. But it seems to fail when it has a current one.

Don't know if this is a bug OR a feature that isn't here yet.

image

And as you can see, it has a history.

image

Permalink my man: https://translate.wordpress.org/projects/wp-plugins/mollie-payments-for-woocommerce/stable/nl-be/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=1614026&sort%5Bby%5D=translation_date_added&sort%5Bhow%5D=asc&historypage****

Warn on double spaces ALL the time, even when the original has one.

Trying to debug and find examples for #44, I wondered:

What if you agreed in your locale that you aren't going to have double spaces because, e.g., "it looks weird" then you have a strange situation when there is one in the original.

-> When you remove the double space, the tool gives a notification that there is one missing.
-> When you place a double space somewhere by accident, no warning is given nor a notification.

So, I think it would be cool if you have a setting where you can say: "Warn on double spaces, regardless of the original" or something of that nature. Where the WPGP-Tools gives off a warning if you have a double space in your translation even when there are double spaces (one or more) in the original.

Fix tag space warning for some languages

Some languages do not use a single-byte space as a word divider. There is no word divider in Japanese, Chinese, Thai, Lao, and Khmer.
https://en.wikipedia.org/wiki/Word_divider?oldformat=true#None

It would be great if the space warning around HTML tags can be modified to accommodate these languages.

Case 1: No spaces UNLESS the tag is next to a single-byte character or symbol (Lao, Japanese, and Khmer)

Correct spacing

Add a space only if tag is next to a single-byte character.

  • 日本語に接している<a href="#">タグ</a>です。
  • 英単語に接している <a href="#">tag</a> です。
  • 英単語に接している "<a href="#">tag</a>" です。
  • 英単語に接している <a href="#">"tag"</a> です。

Incorrect spacing

These are missing spaces around HTML tags.

  • 英単語に接している<a href="#">tag</a>です。
  • 英単語に接している<a href="#">"tag"</a>です。
  • 英単語に接している"<a href="#">tag</a>"です。
  • 不正な<code>function_name</code>。 (for this one, only 1 space is missing – before the opening tag. No space is needed after the closing tag since the character after it is a Japanese period)

Case 2: ALWAYS no spaces (Chinese)

Correct spacing

No spaces before or after tags.

-要发表评论,您必须先<a href="%s">登录</a>。 (See translation history)
-<strong>WordPress升级成功!</strong>请重新登录以查看更新详情。

Add a check for names that should not be translated

Currently if you save a name of a Theme/plugin or link but have translated it, then no warning is shown when saving.
I would be nice if the tool gave a warning about this problem, but it should be put under a parameter.
Not every locale wants names not to be translated.
The following should be checked.

The second request regarding to this is, that it would also be great if this is checked as well when discovering issues on a page

[Small enhancement] Don't throw a warning for perdiod as separator

Is your feature request related to a problem? Please describe.
The original string "number_format_thousands_sep" indicates the seperator and doesn't need a translation. In many cases, it will be "translated" as a simple period. But this gives a warning "Additional end perdiod (.)"

Describe the solution you'd like
Don't show warnings for "number_format_thousands_sep" and "number_format_decimal_point" or don't show warnings if the translated string is only 1 character

String URL to exemplify
https://translate.wordpress.org/projects/wp/dev/de/default/?filters%5Bterm%5D=number_format

Integrate in GlotDict

Hi, I am the creator of GlotDict (https://github.com/Mte90/GlotDict) a browser extension for chrome and firefox with more then 500 users http://mte90.tech/ExtStoreStats//data/glotdict.html.
It is mentioned on polyglots handbook and there are various maintainers with me helping the project moving further.
We were thinking that we can join the forces and integrate everything in GlotDict and add you as mantainers.
I don't know if you are also on the wordpress int slack because we have a chat group there.

Regression: Close all tabs button

To Reproduce
Steps to reproduce the behavior:

  1. Go to any project
  2. Open any QuickLinks or Search tabs
  3. Manually close that tab
  4. Make sure the search field in not empty
  5. Click Close all tabs
  6. A new search result will open, Close all tabs will not disappear

Expected behavior
Close tabs should disappear.

Additional context
Probably the issue is within a toggle logic.

Regression introduced in 1.5

This is because .wpgpt-search-close-tabs button acts like a submit button.
Adding a type="button" fixes the issue.

Don't hide buttons on translated strings.

So, when you open a translated (current) string, the handy buttons for a consistency check, perma link... are gone.

I think it would be handy to still have them since if you quickly need the link to the translation to submit a ticket of a typo... it could be handy to have that button if you already translated it.

No reaction when unneeded punction marks are added in suggestions

So, to save some time, I downloaded the complete translation from nl_NL to tweak for nl_BE for the broken link checker plugin.

Then I noticed this:

image

It seems kinda strange to me that the script can tell you when you are missing a punction mark at the end but when an unneeded one is added, you don't get a warning.

History Tools fails for strings with too large history in default env

Describe the bug
If user has Number of items per page setting at https://translate.wordpress.org/settings/ lower than the number of translations in history, History Tools will fail to work properly.

To Reproduce
Steps to reproduce the behavior:

  1. Activate History Compare and History Count from WPGPT Settings
  2. Go to https://translate.wordpress.org/settings/ and set Number of items per page to 15 (default).
  3. Go to this string that has this history
  4. You'll see that is says: 3 rejected, 11 old and no comparation shown, when in fact it should be 12 rejected and 15 old and with a difference to show.
  5. Set Number of items per page to 30 (or higher if at the time you read this the numbers have changed) and the problem is fixed.

Expected behavior
HistoryTools should work regardless of user settings.

If a waiting string does not have a semi colon in the middle of the sentense, then no warning is shown

The add-on checks for missing semi colon at the end of the sentence. It would be good to check the presence of a semi colon everywhere within the sentence, and throw an error if one is missing.
Example:
https://translate.wordpress.org/projects/wp-themes/gridbox/nl/formal/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=3344973&filters%5Btranslation_id%5D=45467476
afbeelding
Original:
Search Results for: %s
Translation missing the ":"
Zoek resultaten voor %s

Better document the use of cookies/localstorage and the extension. (Saving of user options)

So, it turns out that #25 works just fine... But because I cleaned my cookies & browser cache, it """stopped""" working because, to quote @vlad-timotei himself: "It's very resource consuming this feature, so I only want people that need it to enable it."

So, to help new users or users who aren't too use to this tool... Maybe a warning message about the options being saved in a cookie (and maybe have an import/export feature in the long term) would be extremely handy and make the tool more user friendly imho.

Consistency and GT suggestions don't remember state on single row pages

Describe the bug
Consistency and GT suggestions don't remember state on single row pages

To Reproduce
Steps to reproduce the behavior:

  1. Go to a single string page
  2. Toggle Suggestion from Consistency
  3. Refresh
  4. Toggle state not remembered

Expected behavior
Remember toggle state

Additional context
This works fine on pages with multiple rows. This is something that has to do most probably with a GP implementation of the script. To be investigated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.