GlotPress and Locale Variants

An often requested feature in GlotPress has been to be able to support locale “variants”.  This has been tracked as issue #226 on GitHub and has been open since January 2016.

Locale variants allows for a “root” language to have one or more “variants” of the language in which the variants automatically inherits the translations of the root for any missing translations.

This is useful for many popular languages, for instance English, Spanish, French, etc.  where the vast majority of the translations are likely to be identical with minimal differences for local dialects.

PR #747 has recently been created with a solution for locale variants.

Ok so what does it look like?

The first thing to note that all of the below is based on the current PR, which may change by the time it is actually merged in to GlotPress.

Let’s say you have a project called “Labels”, with three locale’s defined:

  • English (Unites States)
  • Spanish (Spain)
  • English (Canada)

One of these things isn’t like the others, but two of them are very close to being the same.

In the above situation, English (Canada) would inherit the translations form English (United States) for any translations that were not defined.

Going to the translation set page you would see something like this:

 

You’ll notice a new entry in the legend at the bottom of the page, “Root translation”, this indicates any translation shaded in this color (slightly darker green) is inherited from the root language instead of being marked as untranslated (white).

If you select one of these translations to edit you will see the following editor displayed:

Notice the addition of the “Root Translation” information under the Meta heading along with a link back to the root translation.

If you change the translation here and save it, a new translation entry for the locale will be created and the root translation will no longer be inherited.

Looks good so far, so now what?

The PR is mostly complete, however we are looking for some input on one part of the system; the relationship between root and variant languages.

As part of the PR an initial pass at defining the relationships between languages has been made but we are looking for input from the community to ensure they are correct and for any missing relationship that make sense.

One item to note is that root to variant relationships can only go one level deep, so you cannot define a variant of one root as the root of another one.  So in our English example, you cannot do English (United States) -> English (Great Britain) -> English (Canada).  This was done on purpose to ensure translations did not degrade in quality as they moved farther away from the original source language.

The current root/variant relationships in the PR (see the locales.php in the PR for full details) are as follows (the root is the top level name and the variants are in the bullet list):

Arabic

  • Algerian Arabic
  • Moroccan Arabic

Azerbaijani

  • South Azerbaijani
  • Azerbaijani (Turkey)

German

  • German (Switzerland)
  • Swiss German

Greek

  • Greek (Polytonic)

English (Unites States)

  • English (Australia)
  • English (Canada)
  • English (UK)
  • English (New Zealand)
  • English (South Africa)

Spanish (Spain)

  • Spanish (Argentina)
  • Spanish (Chile)
  • Spanish (Colombia)
  • Spanish (Costa Rica)
  • Spanish (Guatemala)
  • Spanish (Mexico)
  • Spanish (Peru)
  • Spanish (Puerto Rico)
  • Spanish (Venezuela)

Persian

  • Persian (Afghanistan)

French (France)

  • French (Belgium)
  • French (Canada)
  • French (Switzerland)

Dutch

  • Dutch (Belgium)

Norwegian

  • Norwegian (Nynorsk)

Portuguese (Portugal)

  • Portuguese (Brazil)

Tamil

  • Tamil (Sri Lanka)

Chinese

  • Chinese (China)
  • Chinese (Hong Kong)
  • Chinese (Singapore)
  • Chinese (Taiwan)

A brief note about the slightly strange English root/variants, English (United States) was chosen as the root due to the vast majority of code that is written with it as the language of the source code.  The root/variants relationships are assigned during the load of the locales file and can be altered for individual sites either through the use of a custom locales.php (using the GP_LOCALES_PATH define) file or through a plugin that hooks in to the GP_INIT hook.

Feedback on the above relationships (or any other part of the PR) is most welcome as always, you can visit the GitHub Issue or PR to participate.

Proposal for the next release of GlotPress

Hello everyone, GlotPress 2.3 was released back in February and in case your were wondering, we’ve been quite busy working on the next release!

GlotPress 2.3.1 has been stable for some time, with the next planned release being 2.4.

What’s been committed so far

Currently committed for 2.4 are the following PR:

  • PR660 – 659: Call actions when a translation set is created/saved/deleted
  • PR663 – 662: Check the ‘active’ checkbox for new projects by default
  • PR661 – 335: Things: Pass previous state to after_save() and *_saved actions
  • PR671 – 669: Improve readability of double-slash hack
  • PR688 – 687: Allow users that can import glossaries to flush them at import
  • PR636 – 628: Support XLIFF tags in android imports.
  • PR706 – 703: Make glossary entry highlights case insensitive
  • PR705 – 704: Add glossary tooltips after editing a row.
  • PR708 – 707: Abort changing status when the translation has be altered.
  • PR717 – 699: Fix issue with dismissing warnings would create a “duplicate” entry
  • PR715 – 701: Fix entry/display of translations that start with a blank line.
  • PR738 – 732: Fix incorrect default in for_export() function for filters.
  • PR740 – 732: Make sure to set the default filter on the export link.
  • PR744 – 743: Fix incorrect variable name for `German (Switzerland)’ google code.
  • PR741 – 733: Add counts to filter links in the translation page.
  • PR771 – 758: Make sure to hide the div that jQuery UI creates for tooltips.
  • PR746 – 745: Check duplicate glossary entries
  • PR766 – 763: Revert any translations changes when cancel is clicked.
  • PR777 – 775: Set the initial hidden state for the bulk priority select with CSS
  • PR772 – 758: Add styles for jQuery UI’s a11y helper
  • PR716 – 704: Alternate add glossary tooltips after editing a row.
  • PR717 – 699: Fix issue with dismissing warnings would create a “duplicate” entry
  • PR722 – Change string for consistency
  • PR738 – 732: Fix incorrect default in for_export() function for filters.
  • PR739 – 734: Add ‘ing’ and ‘ed’ to suffix list for glossary term matching.
  • PR740 – 732: Make sure to set the default filter on the export link.
  • PR741 – 733: Add counts to filter links in the translation page.
  • PR744 – 743: Fix incorrect variable name for `German (Switzerland)’ google code.
  • PR746 – 745: Check duplicate glossary entries
  • PR776 – 776: Add Maltese to locales.php
  • PR765 – 764: highlight selected filter
  • PR766 – 763: Revert any translations changes when cancel is clicked.
  • PR772 – 758: Add styles for jQuery UI’s a11y helper
  • PR773 – 749: Translations: Open the first editor if the current table has only one
  • PR777 – 775: Set the initial hidden state for the bulk priority select with CSS

These PR’s represent incremental changes and bug fixes over GlotPress 2.3.1.

What’s outstanding

In addition, the following items have been marked for the 2.4 release and are either awaiting merges or PRs.

  • IS621 – No information about other translations of the same original
  • IS583 – Replace `wp_get_sites()` with `get_sites()`
  • IS688 – Introduce new locales and update existing data
  • PR619 – Remove invalid ‘me’ language code
  • PR309 – Added locales for Papiamento, Papiamentu, Norther Sotho, Maltese, Zulu, Fula (inclusive code)
  • IS582 – Modal for keyboard shortcuts
  • PR720 – New feature – Add format for NGX-Translate (used in Ionic and Angular projects)
  • IS768 – Block adding Glossary Terms containing punctuation with error/warning
  • IS779 – String containing two of the same Glossary Term doesn’t highlight/underline the second one
  • PR735 – Update Ewe locale with relevant information

Taken together the merged items as well as the marked for 2.4 could support a 2.4 release.

What’s coming up in the near future

However, two significant PR’s are also ready for review:

  • PR747 – 226: support locale variants (see a separate post for more information)
  • PR784 – 666: Add CLDR support

Both of these have API changes to them and are significant features for GlotPress and should be targeted at a major version release, aka 3.0.

Also in the current 3.0 milestone are:

  • PR454 – 452: CLI: Remove deprecated GP_CLI classes.
  • IS729 – Misspelled action and incorrect comment in GP_Original::closest_original()
  • IS723 – Remove deprecated create_function() calls
  • PR627 – Added double quotation marks character to Android escape function
  • PR630 – Correct ‘gp_post_string_similarity_test’ action name and comment

You mean there’s even more?

Beyond the above, there are several additional “low hanging fruit” items that have been put on hold pending the new design, which has been moving slower than we would like:

  • IS304 – Translation header needs some work, because it does wrap weird.
  • IS370 – Show all translation warnings at once
  • IS460 – tooltips for “reject” and “add translation” for editor
  • IS658 – Make notices dismissable
  • IS681] – Copy from original should be a button
  • IS684 – Actions div in the translations editor is sometimes too far from textareas

So what’s the proposal?

This proposal is to fold the 2.4 items in to the 3.0 milestone, add the above “low hanging fruit” design issues to 3.0 and assign 3.0 as the next release for GlotPress.

A tentative timeline for 3.0 would be:

  • Beta 1: September 5th, 2017
  • Beta 2: September 12th, 2017
  • RC 1: September 19th, 2017
  • Release: September 26th, 2017

There is one additional issue that would have to be opened, as we have merged several PR’s that have an “@since 2.4” already, we’ll have to create a PR to update those items to 3.0. To avoid having to update individual PR’s in the 2.4 tag, the recommendation is to merge all remaining 2.4 items and then just before the beta release, do a single PR to update all “@since” tags from 2.4 to 3.0.

Surly that must be it?

Feedback on the above proposal is most welcome and we will be granting final approval for it at next weeks GlotPress meeting in Slack assuming no show stoppers present themselves.

As always, you can visit the GitHub Issue and PR tracker to participate in any of the above items.

GlotPress 2.3 “Statler”

GlotPress Icon

We’re pleased to announce a new release of GlotPress.

Version 2.3 of GlotPress, named “Statler”, is now available for download or update in your WordPress dashboard.

The focus of this release was adding support for JSON formats and for glossaries per locale.

Highlights of this release:

  • Support for locale glossaries, a glossary for all projects of a locale.
  • Support for JSON format for JED and plain JSON, for imports and exports.
  • Ability to mark translations as fuzzy.
  • New keyboard shortcuts for copying original strings.
  • Extended meta data to all file formats that can support it.
  • Want to know more? Read the full changelog here.

Contributors of this release: Alex Kirk, Anton Timmermans, Dominik Schilling, Greg Ross, Nikhil, Pascal Birchler, Sergey Biryukov and Yoav Farhi.

If you want to follow along or help out, please check out our repository on GitHub.

#release, #wordpress-plugin

GlotPress 2.1 “Camilla”

GlotPress Icon

After 3 months we’re pleased to announce the third release of GlotPress as a WordPress plugin.

Version 2.1 of GlotPress, named “Camilla“, is now available for download or update in your WordPress dashboard.

The focus of this release was to improve the database performance and other general enhancements.

Highlights of this release:

  • To increase transparency the user ID of a validator is now stored on translation status changes. You can now see who approved (or rejected 😱) a translation.
  • The permissions list has been updated to use a table view. Gone are the days where you have had to search for users in a tiny list.
  • Imported translations are now checked for warnings too.
  • You have translations which still still a review? Now you import translations with status waiting.
  • PO exports now include a Language header and a Project-Id-Version to improve handling of sub projects.
  • Multiple changes to the database schema to provide the fastest GlotPress so far.
  • Want to know more? Read the full changelog here.

Contributors of this release: Dominik Schilling, Greg Ross, Yoav Farhi, Alexander Kirk, Anton Timmermans, Mattias Tengblad.

If you want to follow along or help out, check out our repository on GitHub.

#release, #wordpress-plugin

GlotPress 2.1 RC 1

The first release candidate of GlotPress 2.1.0 is now available!

This software is still in development. Consider setting up a test site just to play with the new version.

The release candidate can be downloaded from GitHub.

Changes since Beta 1:

  • Allow project slugs to contain periods. (#492)
  • Add confirmation message when saving settings. (#490)
  • Convert sort by fields from hard coded to a filterable function call. (#488)

For more of what’s new in version 2.1, check out the Beta 1 blog post.

If you think you’ve found a bug, you can post to the issue tracker on GitHub.

The final release is targeted for July 13, 2016.

Happy testing!

#488, #490, #492, #development, #release, #wordpress-plugin

GlotPress 2.1 Beta 1

The first beta of GlotPress 2.1.0 is now available!

This software is still in development. Consider setting up a test site just to play with the new version.

The beta can be downloaded from GitHub.

The focus of this release is performance improvements and other general enhancements.

Bugs fixed in this release:

  • Replace LIKE queries for the status of an original with an exact match. (#419)
  • Move gp_translation_set_filters hook to allow additions to the filter form. (#391)
  • Fix wrong error message for translations with a missing set ID. (#341)
  • Fix Android exports with translation that start with an @. (#469)
  • Improve performance of default GP_Translation->for_translation() query. (#376)
  • Use __DIR__ constant for GP_PATH. (#455)
  • Use lowercase field types in schema.php. (#461)
  • Change field type for user IDs to bigint(20). (#464)
  • Don’t call gp_upgrade_data() in gp_upgrade_db() on install. (#361)
  • Define max index length for user_id_action column. (#462)

Features in this release:

  • Allow export by priority of originals. (#405)
  • Check imported translations for warnings. (#401)
  • Allow translations to be imported with status waiting. (#377)
  • Add Language header to PO exports. (#428)
  • Add option to overwrite existing glossary when importing. (#395)
  • Allow modification of accepted HTTP methods in the router. (#393)
  • Update the Project-Id-Version header PO exports to better handle sub projects and be filterable. (#442)
  • Convert the permissions list to a table. (#99)
  • Split translation status counts by hidden and public. (#397)
  • Store user ID of validator/approver on translation status changes. (#293)

In this version 28 issues were solved and 26 Pull Requests were merged, a total of 89 commits.

Contributors of this release: Dominik Schilling, Greg Ross, Yoav Farhi, Alexander Kirk, Anton Timmermans, Mattias Tengblad.

If you think you’ve found a bug, you can post to the issue tracker on GitHub.

The next release (RC1) is targeted for July 6, 2016.

Happy testing!

#293, #341, #361, #376, #377, #391, #393, #395, #397, #401, #405, #419, #428, #442, #455, #461, #462, #464, #469, #development, #release, #wordpress-plugin

GlotPress 2.0.1

GlotPress IconGlotPress 2.0.1 is now available for download or update in your WordPress dashboard!

This is a bugfix release addressing issues found in version 2.0.

Bugs fixed in this release:

  • #386: Avoid a PHP warning when a user had made translations and the user was then deleted.
  • #390: Update all delete permission levels to be consistent in different areas of GlotPress.
  • #404: Fix the CLI export command to properly use the “status” option.
  • #410: Add upgrade script to remove trailing slashes left of project paths from 1.0 which are no longer supported
  • #413: Fix conflict with other plugins that also use the `GP_Locales` class
  • #417: Exclude the art-xemoji locale from length check that caused spurious warnings.

Features in this release:

  • #411: Add Haitian Creole locale definition.
  • #412: Update Asturian locale definition.

In this version 6 issues were solved and 6 Pull Requests were merged, a total of 14 commits.

Contributors of this release: Dominik Schilling, Greg Ross, Yoav Farhi.

If you want to follow along or help out, check out our repository on GitHub.

#glotpress, #release, #wordpress-plugin