-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
100% translatable and localizable on WordPress.org #9
Comments
Some of the build routines for oik plugins are implemented in bobbingwide/oik-i18n/issues/1. In makeoik.php we extend the standard logic in makepot by adding rules for detecting translatable strings. If we simply change the code to perform translation of the parameters using standard WordPress i18n functions then the translations will be attempted multiple times. Code changes will be required for every translatable string.
would need to be changed to
There are approximately 25 functions that performed translation under the covers. Each of these will require a method in the BW_ class which doesn't implement the translation. |
Implementation notes:
|
Issue #9 - add test_oik_tinymce_buttons()
There are some cases where the original strings being translated were incorrect. These should be corrected, then re-translated. |
There are also cases where the original translatable text is written in UK English. It would be better if written for US English. A UK English version would contain the translation. |
There is also one case where an unexpected result is returned from translate. Raised as TRAC 41257 there are at least 2 workarounds.
|
As documented in bobbingwide/oik-libs#7 I have now decided to implement a solution where shared libraries obtain their translated strings from the existing language files that have been loaded by the plugins / themes. There are three parts to the solution.
|
- change replace_admin_url() - swapping parameters to str_replace and making it https:// - update tests that used replace_admin_url() - add message for the assertion in replace_nonce_with_nonsense() - add test for oik_menu_header - add test for oik_menu_footer - add test for oik_plugins_do_page
- Since oik_options_do_page() invokes the Google map we needed to define the sequence in which tests are performed. - phpunit.xml.dist therefore lists the files to test. - we ensure the basic tests for [bw_show_googlemap] are invoked before oik admin tests.
…since wordpress.org's makepot doesn't process .inc files
….org's makepot doesn't process .inc files
…p, convert and test bw_field_function_title en_GB and bb_BB
…d tests for bw_accordion en_GB and bb_BB
…ter.inc to .php, convert some bw_field_function_ routines and test en_GB and bb_BB
Having converted the relevant .inc files to .php files. 10 translatable strings remained in the oik.pot file created by makepot. These were from includes/deprecated.inc. It’s high time this file was sent to the bit bucket. The functions had been deprecated donkey’s years ago. |
Some strings need adjusting for US / UK English.
and Note: It was correctly processed for the |
@GaryJones has found more strings to change:
|
…il is not part of the translatable string
All PHPUnit tests pass in multiple environments. The tests implemented in oik-libs also pass for single site. I'm going to close this on the second anniversary of raising it! |
The oik base plugin was developed in the UK English language using smart APIs that defer processing until the content is really needed. In some cases translation of language strings is deferred.
In order to create the
.pot
file we've been using a fork of the WordPress tool that searches for translatable strings and have extended it to handle a super set of APIs.The WordPress translation tool used at https://translate.wordpress.org/projects/wp-plugins/oik
does not recognise these APIs. Therefore the set of strings to be translated is only a small subset of the actual set.
Two options
Each of these options have their Pros and Cons.
We'll not discuss these now other than for me to say that my preference is for option 2.
I'm just raising this as an Issue to be resolved.
The text was updated successfully, but these errors were encountered: