Git Product home page Git Product logo

wptranslationfiller's Introduction

WordPress Translation Filler (Extended) - Google Chrome/Firefox Extension/Edge

Automatically fill translations on translate.wordpress.org using API's and indicate the accuracy of translation according to locale glossary.

This extension helps with translation of originals on translate.wordpress.org and has the following features:

  1. Fetch translations using API's like DeepL, OpenAI, Google and Microsoft.
  2. Indicate translation accuracy based on uploaded locale glossary.
  3. Provide convenient Approve/Reject button based on translation accuracy.
  4. Integrate Languagetool LT to run spellchecks on your translations.
  5. Replace strings pre/post translation and convert words to lowercase.
  6. Prevent altering brandnames to lowercase, by adding the brands into the field "SpellCheck Ignore words".
  7. Words within this table are also not marked when using "LT spellchecker".
  8. Words within this table will also not get a "hyphen" added within the translation
  9. Improved behavior when GlotDict is also active: GlotDict Google Chrome/Firefox extension.

For full documentation visit the Wiki. If any bugs/problems are found, please add an issue.

Installation

Method 1 (recommended)

  1. Download the Google Chrome extension or Firefox add-on from their respective stores. You can also download the original (non-extended) extension
  2. WordPress Translation Filler Extended will be installed, after which you need to activate and configure it.
  3. Open the options page from within the Extensions or add-ons menu and set the parameters as shown in the Wiki

Method 2 (Chrome only)

  1. Create the ZIP using the dropdown "Code", and download it (https://github.com/vibgyj/WPTranslationFiller)
  2. Move the downloaded ZIP to a installation folder.
  3. Extract the ZIP.
  4. Open Google Chrome extensions and enable Developer mode.
  5. Use the Load unpacked button and point to the extracted folder "\src\manifest".
  6. WordPress Translation Filler will be installed,after which you need to activate and configure it.
  7. Open the options page from within the Extensions or add-ons menu and set the parameters as shown in the Wiki

After installation

  1. After the installation and activation, you will get new buttons within the project.
  2. The "Translate" button above the list translates the whole page selected.
  3. The "Translate" button within the editor, only translates the selected record.
  4. The "Check" button is used to check if the translated page is using glossary verbs.
  5. For other functionality check the Wiki pages.

Git versioning

  1. git tag v1.4.1
  2. git Extended tag 2.7.4
  3. git push --tags

wptranslationfiller's People

Contributors

psmits1567 avatar vibgyj avatar cwbudde avatar toineenzo avatar

Stargazers

 avatar  avatar  avatar  avatar Ken Chan avatar Kharis Sulistiyono avatar Jesús Amieiro Becerra avatar Vlad Timotei avatar feng avatar Yordan Soares avatar Pedro Mendonça avatar Naoko Takano avatar Erica Varlese avatar

Watchers

 avatar  avatar

wptranslationfiller's Issues

spaces are removed when that is not necessary, and spaces are not removed behind

Some examples with new version, blank behind is not removed.
Houd er rekening mee dat de huidige %s -module is verouderd en zal worden verwijderd in toekomstige updates. Gebruik in plaats daarvan de module %s .

Here the blank is removed, which in this case is wrong
Ga na het instellen van het aantal naar%s om elke gateway-optie in te stellen.
It should be
Ga na het instellen van het aantal naar %s om elke gateway-optie in te stellen.

Products %from% - %to% from %total%. Products on page %select_form%
Blank not removed behind
Producten % van% -% tot% van % total% . Producten op pagina%select_form%Here the last % is missing original :Use %s variable for product's base price. For example: %s.
Gebruik de variabele %s voor de basisprijs van het product. Bijvoorbeeld:

Here it is removed where it should not be removed
Hello %1$s (not %1$s? Log out)
Hallo%1$s (niet%1$s? Uitloggen )

Google API: space, capital letter, \

If a translation from Google does not start with a capital, but the original does start with a capital, it would be great if that is corrected on the fly. Also if the line should start with a blank, Google removes that, so that should be checked as well. Same for '' which Google sometimes does not translate.

Google translate moves the placeholders away from the original position

After the placeholders are in place and sent to Google, within the answer they are on the wrong place
Original line
By checking this box, I agree to the WP EasyCart %sterms and privacy policy%s
Translated line
Door dit vakje aan te vinken, ga ik akkoord met de voorwaarden en het privacybeleid van WP EasyCart %s%s
Line before sent to Google
processPlaceholderSpaces found it in original: By checking this box, I agree to the WP EasyCart [0]terms and privacy policy[1]
Link to translation
https://translate.wordpress.org/projects/wp-plugins/wp-easycart/stable/nl/default/?filters%5Boriginal_id%5D=11197957

Issue with replacement verbs

If you add a replacement verb, and you hit enter a new line is created
But this newline is not handled properly, because it generates this error
undefinedHundefinedeundefinedtundefined

quotes are causing a problem when translated

If a sentence contains a quote around a placeholder, some strange behavior is present after the translation
Original
Booster: Free plugin's version is limited to only one "%1$s" product with settings on per product basis enabled at a time. You will need to get Booster Plus to add unlimited number of "%1$s" products.
Translated
Booster: de versie van de gratis plugin is beperkt tot slechts één ";%1$s"; -product waarbij de instellingen per product tegelijk zijn ingeschakeld. Je hebt Booster Plus nodig om een onbeperkt aantal ";%1$s"; producten toe te voegen.
link to line
https://translate.wordpress.org/projects/wp-plugins/woocommerce-jetpack/stable/nl/default/?filters%5Boriginal_id%5D=4801170
It can be fixed by adding this into the verb replacement ->"," e.g. replace '"" by the quote '"' sign

Currently the addon notifies if a translation misses a glossary verb, but it would be great if a list of verbs could be defined to replace them

in the current version a warning is shown when a glossary word is not present within the translation.
That is a great functionality, but it would save time if you could also define a list of verbs that automatically are replaced.
Because not all lines in the glossary can be used for that purpose depending on the translation
But there are some verbs/nouns that can be replaced independent of the translation
Example in the nl_NL glossary we have "website" which should be translated as "site"
This is a verb that is very often used, so instead of the warning it can be replaced automatically
This would again save time

Placeholder not correctly improved

Google messes up the placeholders by adding spaces. To convert it back to the original the spaces need to be removed. This has partially been fixed, but in the following situation it does not work
Original line contains:
an %1$soutdated
Translated into locale nl_NL:
een% 1 $ verouderde

The blanks are not removed, and the "s" character is missing
Test line in wordpress.org
https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack/dev/nl/default/?filters%5Boriginal_id%5D=10991311

Translation improvement stored within the option are lost after disabling and enabling the add-on

With the latest version you have the option to store translation improvements after the add-on retrieves translation.
As long as you keep the add-on active, they stay in memory.
But if you disable and enable the add-on, they are gone.
That is not very friendly, because sometimes you need to disable an add-on for troubleshooting purposes.
It would be better to store them in the same place as the API key and glossary file.
Especially if you have a large list of substitutions.

Enhancement If a glossary contains a verb with lowercase, but the translation has Uppercase as first letter it is concerned wrong

If a verb in the glossary has lowercase it is considered wrong if the translation has a uppercase
Example glossary has template, template
Translation has Template, it is considered an error
If you add the same verb into the glossary, then the match does not work
If you alter the Uppercase into lowercase, then the bar becomes green
Maybe consider to alter the behavior, so if a verb is present with lowercase, then the uppercase verb is also considered to be good
Test link below
https://translate.wordpress.org/projects/wp-plugins/ecommerce-product-catalog/stable/nl/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=1538147&filters%5Btranslation_id%5D=76357103

If a translation has been saved with an error, and you reopen this translation the colored bar is not shown

If you translate manually without the button "Translate" it will show a colored bar if there is a word not properly translated as is in the glossary. If you save such a translation and reopen the translation, I would expect the colored bar to popup again, as the translation contains a word that is not ok according the glossary
afbeelding
Here the word "pagina's" is the same as within the glossary, so either a green bar should be shown, or the colored bar indicating the error as it previously stated "pagina's"

Due to the unwanted behavior when translating with Google blanks are added where they where not before

In case a line contains the following original
The permalink for the current page/post.
De permalink voor de huidige pagina / post.

The forward slash gets a blank before and after
So if possible they should be removed

That also happens with the "&" in some cases, but will be hard to fix
The permalink for the current Proctor&Gamble.
De permalink voor de huidige Procter & Gamble.
It depends on the verbs present in the original
Because sometimes for the locale the & sign is replaced by a verb, so then the & is no longer present

To save money it would be great to have a default library of translations

Currently if there is no translation, it will be fetched from Google, which costs money
There are a lot of default translations in every plugin/theme
So before demanding the translation from Google or other translation engines, a search in the local database could be done to find a default translation. Then it would not cost money and might be quicker to translate under circumstances.
Example "Save", "Next", "Previous", "Back" those are all default translations
Example "Are you sure?"
Example "Select a page"

Capitals at the beginning of the line

Sometimes depending on translation the translated line does not start with a capital
If the original does have a capital, then the translated text should also have a capital at the beginning
The other way around if the original does not start with a capital, then the translated line should also not start with capital

Certain characters are replaced or removed in the locales. These need to be removed after translation

The following placeholder stays behind after translation ’
Example:
It seems we can’t find what you’re looking for. Perhaps searching can help.
Het lijkt erop dat we ’ niet kunnen vinden wat u ’ zoekt. Misschien kan zoeken helpen.
Putting it into the replacement list without replacement would be a solution
But that does not work currently.
’,test
Result
undefinedHundefinedeundefinedtundefined

Populate empty translations with the first translationmemory from translate.wordpress.org

Currently it is possible to translate a single line (great function)
But we also have 100% suggestions if we go into the to translate line
After you go in you will see 100% suggestions below the empty box
I think it would be great if the first of those suggestions can be copied into the textfield automatically
If the 100% suggestion is fine than it saves translation via Google, and you do not need to click on copy below

Default Formal is used when translating

If the extension translates, it gets the formal translation back. This is a bit annoying as the sentence is not correct. There are several locales that have a formal translation as well.
There is no official toggle to change this, however there is a solution obviously, as with deepl.com there is a toggle to change this
The solution is not that difficult, example below.
Sentence: You are a nice person
Translated: U bent een aardig persoon
Change the "You" into "Je" which is informal
Translation: Je bent een aardig persoon
Notice the change in the first two verbs
Germany has formal
Belgium has formal
This is obviously a new feature, but important to have. When implementing it should be possible to set the verb to trigger this as a param, or there must be an official toggle to switch it. When translating you need to set this in the project to switch to formal

Duplicate placeholders

There is a problem with replacing the placeholders. Sometimes you get a double Font-size adjustment in more places: now, font-size controls are right where you need them in the List and Code blocks. No more trekking to another screen to make that single change!
Translated
Aanpassing van lettergrootte op meer plaatsen: nu zijn de besturingselementen voor lettergrootte precies daar waar u ze nodig hebt in de lijst- en codeblokken. U hoeft niet meer naar een ander scherm te trekken om die ene wijziging aan te brengen!
It depends on the length of the sentence in my opinion

If a sentence contains two or three times the same placeholder, then the replace is done on all matchin placeholder

If a sentence contains the same placeholder more than once, the replace currently replaces all matching placeholders.
As we know the position of the placeholder, we need regex replace to replace only the position
Example line
%2$s published. %1$sView %2$s%3$s.
Translated with my latest version (my current version does not not remove the blank behind in this situation)
The line below is as a result of my default replace without regex
Now it goes wrong because it finds two times %2$s and this removes the blank after the first one as well
%2$sgepubliceerd. %1$sZien %2$s%3$s.

Tested with restopress development
https://translate.wordpress.org/projects/wp-plugins/restropress/dev/nl/default/?filters%5Boriginal_id%5D=8742207

If the %d is not a placeholder, but part of a verb, than it is still converted to a placeholder, causing a blank to be left behind

Sometimes %d is not a placeholder, but it is a preceded by a % sign, so it should not be treated as a placeholder for %d
Test example:
https://translate.wordpress.org/projects/wp-plugins/woocommerce-jetpack/stable/nl/default/?filters%5Boriginal_id%5D=5659716
Original contains:
%product_title% is not available until %direct_date%.
Translation contains:
% product_title% is niet beschikbaar tot %d irect_date%.

Translation of the UI

Currently the UI is in English in FireFox and Chrome, for internationalization it would be great if the add-on would be in native language.
Low priority

New placeholder needs to be difined for %1s

It appears that %1s is not put into a placeholder, which causes a blank between % 1s
Link to test with
https://translate.wordpress.org/projects/wp-plugins/mainwp/stable/nl/default/?filters%5Bterm%5D=%251&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=translation_date_added&sort%5Bhow%5D=asc
Original text
No ignored %1s
Translated
Geen genegeerde% 1s
Debug dump
After pre-processing: No ignored %1s googleTranslate.js:313:13
format type text googleTranslate.js:53:13
request body
Object { q: "No ignored %1s", source: "en", target: "nl", format: "text" }
googleTranslate.js:61:13
sendAPIreQuest original_line: No ignored %1s googleTranslate.js:68:10
Translated text: Geen genegeerde% 1s

If you are within the to translate line,and the translation is already present the button for translation does not work

If you go into a already translated line, and you select "translate" then nothing happens.
If you select the general "translate button" then the line gets translated.
So it appears that the translation function is not called if the translation is already present
For practical purposes this should also work in already translated lines using the inline button (test purposes originally)

Google API Tutorial

Create a guide here in the WIKI section, for example. How to create that API key.

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.