Summary: | Language menu not show up as name for Thai (th-THA was shown) | ||
---|---|---|---|
Product: | Koha | Reporter: | Pongtawat <pongtawat> |
Component: | I18N/L10N | Assignee: | Bugs List <koha-bugs> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | bgkriegel, f.demians, fridolin.somers, gmcharlt, mtompset |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11973 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 11393 - Language menu not show up as name for Thai (th-THA was shown)
[SIGNED OFF] Bug 11393 - Language menu not show up as name for Thai (th-THA was shown) Bug 11393 - Untested patch for doing the human intervention part. [PASSED QA] Bug 11393 - Language menu not show up as name for Thai (th-THA was shown) |
Description
Pongtawat
2013-12-13 07:46:12 UTC
Created attachment 26646 [details] [review] Bug 11393 - Language menu not show up as name for Thai (th-THA was shown) The problem is with the name of PO files Currently Koha expect, among other variants, that PO filenames began with (using as example *-pref.po): {lang}-pref.po {lang}-{region}-pref.po {lang}-{scrip}-pref.po {lang}-{script}-{region}-pref.po and expect 2 chars for lang and region, and 4 for script So the problem with Thai translation files are that it's names do not match that convention. This patch only rename Thai files as th-THA-* to th-TH-*. In that way language description is right. translate script use that chars to make dirs, and use dirs to find description. To test: 1) Go to I18N/L10N sysprefs 2) Install th-THA language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-THA) 3) Reload page, wrong description 4) Apply patch 5) Install th-TH language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-TH) 6) Reload page, right description 7) If you want do "mkdir koha-tmpl/intranet-tmpl/prog/th-Thai", reload, also right description To the reporter of this Bug: the rename of the folder is a good workaround, when this patch is pushed to stable I'll rename Thai files git checkout -b bug_11393 origin/master cd misc/translator perl translate install th-THA (ignoring lots of warnings/errors) staff client -> home -> koha administration -> global system preferences -> I18N/L10N check both th-THA's save reload the page lang menu appears on bottom. apply the patch reload the page -- still th-THA rm -rf ../../koha-tmpl/intranet-tmpl/prog/th-THA/ rm -rf ../../koha-tmpl/opac-tmpl/bootstrap/th-THA/ rm -rf ../../koha-tmpl/opac-tmpl/ccsr/th-THA/ rm -rf ../../koha-tmpl/opac-tmpl/prog/th-THA/ perl translate install th-TH (ignoring lots of warnings/errors) reload the page -- now th-TH and correct description. Hi Marc, If you translate first with th-THA files it fails, because those filenames do not match the lang If you raname first and then translate all is right, I think :) What do you find wrong? Regards, Bernardo (In reply to Bernardo Gonzalez Kriegel from comment #3) > If you translate first with th-THA files it fails, because those filenames > do not match the lang. yes. > If you [rename] first and then translate all is right, I think :) yes. > What do you find wrong? I was it expecting it to fix my mistaken installation of th-THA. Is that what it should do? Some code in updatedatabase.pl (though probably the wrong place for it) could easily check for and rename the directories if they exist. After all, that is what the original reporter said was the solution for the scenario. (In reply to M. Tompsett from comment #4) > I was it expecting it to fix my mistaken installation of th-THA. Is that > what it should do? > > Some code in updatedatabase.pl (though probably the wrong place for it) > could easily check for and rename the directories if they exist. > > After all, that is what the original reporter said was the solution for the > scenario. Well, I know that this patch is pointless as a solution to the reporter problem. The real solution is not only change names or update database for current installs, we need to rename some dirs on current installation and that is beyond of what we can do (or I are willing to do) I will rename all th-THA* -> th-TH files on translation server, that will be included on next release or update of master (perhaps if Bug 7939 pass), and this becomes moot. The intent of this patch was to update th names on master, to show that in that way it solves the problem. Normal releases do not change or update translation files on master. If you think that is not enough, I'll put it to sleep. Thank you for testing :) Created attachment 26688 [details] [review] [SIGNED OFF] Bug 11393 - Language menu not show up as name for Thai (th-THA was shown) The problem is with the name of PO files Currently Koha expect, among other variants, that PO filenames began with (using as example *-pref.po): {lang}-pref.po {lang}-{region}-pref.po {lang}-{scrip}-pref.po {lang}-{script}-{region}-pref.po and expect 2 chars for lang and region, and 4 for script So the problem with Thai translation files are that it's names do not match that convention. This patch only rename Thai files as th-THA-* to th-TH-*. In that way language description is right. translate script use that chars to make dirs, and use dirs to find description. To test: 1) Go to I18N/L10N sysprefs 2) Install th-THA language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-THA) 3) Reload page, wrong description 4) Apply patch 5) Install th-TH language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-TH) 6) Reload page, right description 7) If you want do "mkdir koha-tmpl/intranet-tmpl/prog/th-Thai", reload, also right description To the reporter of this Bug: the rename of the folder is a good workaround, when this patch is pushed to stable I'll rename Thai files Signed-off-by: Mark Tompsett <mtompset@hotmail.com> This does not correct existing problems which need human intervention. It does, however, allow for a correct installation of Thai after the patch is made. If we really want a patch for fixing an existing install. I wrote it, but have not tested it. Created attachment 26689 [details] [review] Bug 11393 - Untested patch for doing the human intervention part. This is intentionally going to be obsoleted, but attached to the bug so it could be referenced, if needed. File::Copy is already a dependency, and File::Find is a core module as far as I can tell. Comment on attachment 26689 [details] [review] Bug 11393 - Untested patch for doing the human intervention part. Intentionally obsoleted, because I don't think it is wanted at this time, nor is it preferred. However, I do want it somewhere accessible if someone would like to see my attempt. Created attachment 26706 [details] [review] [PASSED QA] Bug 11393 - Language menu not show up as name for Thai (th-THA was shown) The problem is with the name of PO files Currently Koha expect, among other variants, that PO filenames began with (using as example *-pref.po): {lang}-pref.po {lang}-{region}-pref.po {lang}-{script}-pref.po {lang}-{script}-{region}-pref.po and expect 2 chars for lang and region, and 4 for script So the problem with Thai translation files are that it's names do not match that convention. This patch only rename Thai files as th-THA-* to th-TH-*. In that way language description is right. translate script use that chars to make dirs, and use dirs to find description. To test: 1) Go to I18N/L10N sysprefs 2) Install th-THA language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-THA) 3) Reload page, wrong description 4) Apply patch 5) Install th-TH language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-TH) 6) Reload page, right description 7) If you want do "mkdir koha-tmpl/intranet-tmpl/prog/th-Thai", reload, also right description To the reporter of this Bug: the rename of the folder is a good workaround, when this patch is pushed to stable I'll rename Thai files Signed-off-by: Mark Tompsett <mtompset@hotmail.com> This does not correct existing problems which need human intervention. It does, however, allow for a correct installation of Thai after the patch is made. If we really want a patch for fixing an existing install. I wrote it, but have not tested it. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> As pointed out by Mark, this does not fix existing installations. Putting a note in the release notes might be something we can do here. Pushed to master. Thanks, Bernardo! Already in 3.14 from PO updates |