satellitewp / po-merger Goto Github PK
View Code? Open in Web Editor NEWMerge PO files from two similar languages to facilitate translation
License: GNU General Public License v3.0
Merge PO files from two similar languages to facilitate translation
License: GNU General Public License v3.0
When a translation is added to the dictionary, it is tagged as fuzzy.
It could be very helpful to add a comment with the theme or plugin name where the translation comes from
and
maybe a counter.
Then when the same translation is found,
Only the core project is mergeable. The translation merge should also generate PO files for sub projects too.
URLs for sub projects:
5.0.x
https://translate.wordpress.org/projects/wp/5.0.x/fr-ca/default/
Continent and cities
https://translate.wordpress.org/projects/wp/4.9.x/cc/fr-ca/default/
Administration
https://translate.wordpress.org/projects/wp/4.9.x/admin/fr-ca/default/
Network admin
https://translate.wordpress.org/projects/wp/4.9.x/admin/network/fr-ca/default/
Stat number "Copied from copy locale" is incorrect because includes empty strings.
So when reading the results (ex Copied from copy locale: 102) you think to have many string to review but in fact sometimes 102 strings are empty...
Need to add a filter for empty strings in copy locale to avoid counting it.
Location to fix this issue: po_merger.php line from line 167 to 194
Quick fix adding simple test:
if(false === empty($copy_tr)) {
$used_from_copy++;
}
or maybe better for performance change the test to break the loop if the string is empty
if(true === empty($copy_tr)) {
continue;
}
Since a major refactoring occurred, the tests are broken and must be adjusted.
We will need help for this. It is pretty much copy/pasting old tests and adjust class names. Also, we need to create missing tests.
These URLs should be supported:
The same behavior applies to plugins. Validate for meta and apps.
The function assumes a header always contains the same number of lines... which isn't true.
The header consists of introductory comments, followed by the empty msgid, and by the msgstr which contains header fields. The header comments, similar to those of normal messages, are not entirely free form, but have some structure to them. The msgstr is divided by newlines (\n) into fields of name: value form (the name of the piece of information and the information itself). Although the header is pristine, some of the environment-dependent values are typically already supplied, e.g. wherever the KDE is mentioned in this example. The fuzzy flag indicates that the PO file has not been translated earlier. All-uppercase text segments are placeholders which you should replace with real values.
http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html#sec-poheader
The following commands show errors:
wp po merge fr-ca fr https://wordpress.org/plugins/disable-comments/ --diff-only --fuzzy=/app/packages/fr-ca.txt
wp po merge fr-ca fr https://wordpress.org/plugins/simple-custom-css/ --fuzzy=/app/packages/fr-ca.txt
Message received:
Error: The parameters have errors.
The reason is the environment used (development) is not supported as we use 'stable' by default. A parameter should be added to support this.
An enhancement after fixing issue Wrong stat number for "Copied from copy locale" could be to add a new stat counter with empty string left after po-merger has done its work to indicate how many untranslated strings are still untranslated.
When passing the source parameter, the expected URL is something like:
https://wordpress.org/plugins/contact-form-7/
It would be nice if we could use this URL too:
https://translate.wordpress.org/projects/wp-plugins/contact-form-7/
If WordPress, a theme or a plugin generated PO file should not contain anything because there is no translation to merge or validate, a message should be displayed like this:
The query could not generate any strings to merge. Please check if the project is already fully translated.
We should be able to run the package in whatever folder we are. WordPress shouldn't have to be installed.
@when before_wp_load
See this:
https://make.wordpress.org/cli/handbook/commands-cookbook/#docblock-tags
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.