Include Plupload i18n file in generated language pack#5707
Open
Kanonimpresor wants to merge 1 commit into
Open
Include Plupload i18n file in generated language pack#5707Kanonimpresor wants to merge 1 commit into
Kanonimpresor wants to merge 1 commit into
Conversation
The Language Pack generator (lancheck.php -> getFileList) bundled .php/.xml from languages, plugins, themes, handlers and help, but never the Plupload uploader translation at e107_web/js/plupload/i18n/<iso>.js. As a result, fresh installs of any generated pack left the file/media/mailout uploader in English regardless of the selected site language. getFileList() now resolves the ISO-639-1 code from findLocale() and, when e107_web/js/plupload/i18n/<iso>.js exists, appends it to the archive list. Because the archive is created with PCLZIP_OPT_REMOVE_PATH e_BASE, the file is stored at the correct e107_web/js/plupload/i18n/<iso>.js path. Core only ships en.js; translators can drop their locale file in and have it packaged. Refs e107translations/Translator-Information#5
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.
Problem
When an admin generates a Language Pack from Admin → Tools → Language Check → Generate Language Pack (
e107_admin/lancheck.php), the resulting ZIP bundles.php/.xmlfrome107_languages/,e107_plugins/,e107_themes/,e107_handlers/ande107_docs/help/, but it never includes the Plupload uploader translation ate107_web/js/plupload/i18n/<iso>.js.As a consequence, a fresh install of any generated pack leaves the Plupload uploader (file manager, media manager, mailout attachments, …) in English no matter which site language is selected. Translators currently have to ship the
.jsout-of-band or tell users to copy it manually.Fix
getFileList()is the single place that builds the array of files handed to$archive->create($data, PCLZIP_OPT_REMOVE_PATH, e_BASE). The fix resolves the ISO-639-1 code from the existingfindLocale()helper and, only ife107_web/js/plupload/i18n/<iso>.jsexists, appends it to that list:Because the archive is created with
PCLZIP_OPT_REMOVE_PATH e_BASE, the file is stored at the correct pathe107_web/js/plupload/i18n/<iso>.jsinside the ZIP — no extra$archive->add()call needed.Behaviour
es.jsexistses.jspackaged ate107_web/js/plupload/i18n/es.jspt.jsexistspt.jspackaged.jsyetfindLocale()can't resolveScope / safety
getFileList()), +16 lines, no deletions.getFileList()(notmakeLanguagePack()) to stay conflict-free with PR Fix language-pack generation in lancheck.php (v2.3.5+ regressions) #5703, which is in review and edits the XML-manifest block ofmakeLanguagePack().en.js; this simply lets a translator's locale file be picked up automatically when present.Refs e107translations/Translator-Information#5
Disclosure: parts of this contribution were prepared with AI assistance and reviewed by me before submission.