add baseline translation support for the chooser - #185
Draft
possumbilities wants to merge 25 commits into
Draft
possumbilities wants to merge 25 commits into
possumbilities wants to merge 25 commits into
Conversation
95% of minimum 90% translated source file: 'vocabulary-theme.pot' on 'en_US'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
…6436ca271e2030b794738_en_US Updates for project Chooser and language en_US
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
wp cli i18ncommand encounters errors when trying to manipulate files #186docker-compose.ymlto mount the vocabulary-theme src directory appropriate, and setsworking_dirto that directory in thewordpress-clisectiontransifex.ymlconfiguration filesrc/languagesdirsrc/languages/vocabulary-theme.potfilestatic-chooser.php(minus marking statements) for WordPress appropriate gettext string extraction viawpcli.poand.mofiles (via Transifex) for English to test with, to thesrc/languagesdirectory<html>langattribute toheader.phpsrc/languages/files within WordPress's locale functionality, specifically targeting thechoosertextdomain.langURI parameter within WordPress for setting the language via the frontend dropdown selectchoosertextdomainTechnical details
The source
.potfile is generated fromwpcli(pulled from the wrapped strings instatic-chooser.php):wpcli i18n make-pot . languages/vocabulary-theme.pot --domain=chooserThe file is read through Transifex via the
transifex.ymlconfig, and loaded in for manual translation within the Transifex editor, wherein an end-user can select an available language to begin a translation from the source (en)Once a translation is ready, Transifex can generate a language specific
.pofile, which is sync'd with GitHub via the GH Integration. The relevant<lang>.pofile is added to thesrc/languagesfolder. It is important that the.pofile in question not have a theme or textdomain specific prefix, as WordPress will not recognize the file otherwise. For testing purposes theen_US.poanden_US.mofiles have been created (temporarily), and the stringsYesandNohave been set toYepandNoperespectively to verify correct files are loaded based on alangURI parameter being set to?lang=en_USOnce Transifex has reached an appropriate translation threshold and fired off the integration for
.pogeneration, it will create a relevant PR, which can be approved, and merged.wpclican then be used to generate a corresponding.mofile:wpcli i18n make-mo languages/Logic within the theme should now allow the newly add
<lang>to be selectable within the available translation dropdown, which operates by setting thelangparameter in the URI.If a valid
.mofile is found to match the setlangparameter, then the appropriate language translation is loaded, otherwise it will default to the original source (en).Tests
Screenshots
Checklist
Update index.md).mainormaster).visible errors.
Developer Certificate of Origin
For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."
Developer Certificate of Origin