Bug 11393 - Language menu not show up as name for Thai (th-THA was shown)
Summary: Language menu not show up as name for Thai (th-THA was shown)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-13 07:46 UTC by Pongtawat
Modified: 2015-06-04 23:23 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11393 - Language menu not show up as name for Thai (th-THA was shown) (3.60 KB, patch)
2014-03-27 13:46 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED OFF] Bug 11393 - Language menu not show up as name for Thai (th-THA was shown) (3.91 KB, patch)
2014-03-29 23:25 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 11393 - Untested patch for doing the human intervention part. (3.76 KB, patch)
2014-03-29 23:28 UTC, Mark Tompsett
Details | Diff | Splinter Review
[PASSED QA] Bug 11393 - Language menu not show up as name for Thai (th-THA was shown) (4.22 KB, patch)
2014-03-31 16:05 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pongtawat 2013-12-13 07:46:12 UTC
When Thai translation is installed and enabled. The language menu at the bottom of OPAC screen shown up as language code "th-THA". Also, the preference "language" and "opaclanguage" also show up as "(th-THA)".

However, if I change the Thai template folder from "opac-tmpl/prog/th-THA" to "opac-tmpl/prog/th", the language menu, as well as the preferences, will display entry for Thai as "ภาษาไทย" which is correct.

So, I don't know if there is some value missing (or incorrect) in database for "th-THA" or that the translation template should be "th".
Comment 1 Bernardo Gonzalez Kriegel 2014-03-27 13:46:38 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2014-03-29 04:09:27 UTC
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.
Comment 3 Bernardo Gonzalez Kriegel 2014-03-29 05:41:43 UTC
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
Comment 4 Mark Tompsett 2014-03-29 11:58:59 UTC
(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.
Comment 5 Bernardo Gonzalez Kriegel 2014-03-29 13:01:49 UTC
(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 :)
Comment 6 Mark Tompsett 2014-03-29 23:25:46 UTC Comment hidden (obsolete)
Comment 7 Mark Tompsett 2014-03-29 23:28:31 UTC Comment hidden (obsolete)
Comment 8 Mark Tompsett 2014-03-29 23:30:09 UTC
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.
Comment 9 Katrin Fischer 2014-03-31 16:05:57 UTC
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.
Comment 10 Galen Charlton 2014-04-03 15:43:26 UTC
Pushed to master.  Thanks, Bernardo!
Comment 11 Fridolin Somers 2014-06-19 14:40:34 UTC
Already in 3.14 from PO updates