Git Product home page Git Product logo

po-merger's People

Contributors

hamid159 avatar maximejobin avatar mehrshaddarzi avatar pavelzaharciuc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

po-merger's Issues

Enhancements for managing dictionary catalog

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,

  1. theme or plugin name is watched to check if it is not the same as before
  2. New theme or plugin name is added in the comment
  3. the counter is increased
  • A trigger for the counter, let's say 3 will remove the fuzzy tag of the translation. So when the same translation is found 3 times, we consider this is a popular translation.
    It still could be changed manually based on the glossary and consistency WordPress tools.
    But this will help a lot to automate dictionary catalog and time saving to build a wide dictionnary.

Support WordPress sub project translations

Only the core project is mergeable. The translation merge should also generate PO files for sub projects too.

image

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/

Wrong stat number for "Copied from copy locale"

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;
}

Fix tests and add missing ones

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.

Function has_only_header is flawed

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

Good parameters return errors

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.

Support translation URL

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/

Generating empty file

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.

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.