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

226: support locale variants #747

merged 17 commits into from Jan 3, 2019

Conversation

@toolstack
Copy link
Contributor

toolstack commented Jun 27, 2017

Resolves #226 .

@toolstack toolstack force-pushed the 226-support-locale-variants branch from 6575e41 to a5d3de8 Jun 27, 2017
@toolstack toolstack requested a review from ocean90 Jun 27, 2017
@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;

This comment has been minimized.

Copy link
@swissspidy

swissspidy Jul 12, 2017

Member

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.

This comment has been minimized.

Copy link
@pixelverbieger

pixelverbieger Jul 12, 2017

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

This comment has been minimized.

Copy link
@swissspidy

swissspidy Jul 12, 2017

Member

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.

This comment has been minimized.

Copy link
@toolstack

toolstack Jul 12, 2017

Author Contributor

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
As per the discussion here: #747 (comment)
@toolstack toolstack force-pushed the 226-support-locale-variants branch from fdaafa1 to 5ea50d0 Jul 12, 2017
toolstack added a commit that referenced this pull request Jul 12, 2017
As per the discussion here: #747 (comment)
@GlotPress GlotPress deleted a comment from fiona0407 Aug 3, 2017
@toolstack toolstack force-pushed the 226-support-locale-variants branch from 83da488 to 2e25365 Oct 8, 2017
toolstack added a commit that referenced this pull request Oct 8, 2017
@toolstack toolstack force-pushed the 226-support-locale-variants branch from 8d79097 to c400170 Oct 8, 2017
@toolstack toolstack force-pushed the 226-support-locale-variants branch from 21f5d61 to feeb2ae Oct 17, 2017
toolstack added a commit that referenced this pull request Oct 17, 2017
@toolstack toolstack force-pushed the 226-support-locale-variants branch from 0b9c55d to 53836f0 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 toolstack force-pushed the 226-support-locale-variants branch from 1824c06 to c0d9348 Oct 25, 2018
toolstack added a commit that referenced this pull request Oct 25, 2018
@toolstack toolstack force-pushed the 226-support-locale-variants branch from dbedf1b to 6eb21fb Oct 25, 2018
@xavivars
Copy link

xavivars commented Oct 26, 2018

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

toolstack commented Oct 26, 2018

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 Oct 30, 2018
@toolstack toolstack force-pushed the 226-support-locale-variants branch from 77f9188 to 9446ca5 Nov 8, 2018
@xavivars
Copy link

xavivars commented Nov 28, 2018

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

toolstack commented Nov 28, 2018

@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.

@toolstack toolstack force-pushed the 226-support-locale-variants branch from 9446ca5 to 2c28a33 Jan 2, 2019
toolstack added 4 commits Jan 2, 2019
This can be used with the GP_LOCALES_PATH define to  effectively disable variants.
@toolstack toolstack merged commit ccdebb9 into develop Jan 3, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@toolstack toolstack deleted the 226-support-locale-variants branch Jan 3, 2019
@xavivars xavivars mentioned this pull request Mar 28, 2019
3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.