Skip to content
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

226: support locale variants #747

Merged
merged 17 commits into from Jan 3, 2019
Merged

Conversation

toolstack
Copy link
Contributor

@toolstack toolstack commented Jun 27, 2017

Resolves #226 .

@toolstack toolstack force-pushed the 226-support-locale-variants branch from 6575e41 to a5d3de8 Compare June 27, 2017 21:18
@toolstack toolstack requested a review from ocean90 June 27, 2017 21:18
@toolstack toolstack added this to the 3.0 milestone Jun 30, 2017
@@ -972,6 +1010,8 @@ public function __construct() {
$gsw->country_code = 'ch';
$gsw->wp_locale = 'gsw';
$gsw->slug = 'gsw';
$gsw->variant_root = $de->slug;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that while German (Switzerland) as a variant of standard German makes sense, Swiss German (gsw) is something completely different. It's a dialect (well, more than 26 different dialects to be precise) that has nothing in common with regular German. As such, $gsw shouldn't be a variant of $de.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

… while de_DE_formal is missing and should be added to the list of variants for German

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be handled somewhere else though 🙂 de_DE_formal is not listed in locales.php after all, it's probably just a WordPress.org thing.

Copy link
Contributor Author

@toolstack toolstack Jul 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @swissspidy, I'll remove the relationship.

@pixelverbieger I'm sure there will be many new variants added, like de_DE_formal once the the PR is merged, currently swsisspidy is correct that the formal variants are handled by translate.w.org separately.

toolstack added a commit that referenced this pull request Jul 12, 2017
@toolstack toolstack force-pushed the 226-support-locale-variants branch from fdaafa1 to 5ea50d0 Compare July 12, 2017 12:45
toolstack added a commit that referenced this pull request Jul 12, 2017
@GlotPress GlotPress deleted a comment from fiona0407 Aug 3, 2017
toolstack added a commit that referenced this pull request Oct 8, 2017
toolstack added a commit that referenced this pull request Oct 17, 2017
gp-templates/translation-row.php Outdated Show resolved Hide resolved
@HughP
Copy link

HughP commented Apr 21, 2018

I’m not sure why the code invokes iso 629-2 codes. BCP 47 Tags should be used.

I don’t have a problem with the fallbacks chosen. They make sense. But it seems that the coding seems more complex than needed. ISO 639-2 and 639-3 are alligned for the purposes of locale codes CLDR or Iana should have the already Approved codes.

@toolstack toolstack modified the milestones: Future, 3.0 Oct 12, 2018
toolstack added a commit that referenced this pull request Oct 25, 2018
@xavivars
Copy link
Contributor

Any idea of progress on this PR?

While discussing about the details could take forever (this language is/is-not a variant of another language), the functionality itself it's extremely useful for cases that are clear. For example, we now have *Valencian (ca-valencia, Catalan as spoken in Valencia), and falling back to English is simply not an option: there aren't enough translators to keep all themes/plugins up to date in both variants.

@toolstack
Copy link
Contributor Author

It will be merged as part of 3.0, which is scheduled for a Dec 20th release.

@toolstack toolstack force-pushed the 226-support-locale-variants branch 2 times, most recently from c728f45 to 304745d Compare October 30, 2018 22:00
@xavivars
Copy link
Contributor

I guess ca-valencia will need to be added as a variant of ca in locales.php for this case to work, right?

@toolstack
Copy link
Contributor Author

@xavivars Correct, it can be done for a site by either hooking in to the gp_locale_definitions_arrary filter or creating a custom locales file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants