6.0.0-alpha10
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
5/15/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#15081] Language codes get falsely trimmed two two letters
*
Your Email Address
*
Spam protection
Enter the letters below:
._.. ..__ ..___. | \ /[__) | | _|_ \/ | \\__| |
Comment
> In the Native Language Support file Nls.php:280 [1] the language code > is trimmed to two characters. Probably under the assumption that > language codes are always ISO 639 and all character after that are > country subtags. But RFC 3282 [2} and RFC 3066 [3] clearly allow > three letter language codes from ISO 639-2 and some reserved codes. > > This excludes languages as important as Cebuano (ceb) with 30 million > speakers in the Philippines and even misinterprets Cebuano as Chechen > (ce). > > I came across this error when the accept-language mail header for Low > German (nds) was misreported as North Ndebele (nd). > > The correct fix is to allow all valid language codes. That should be > doable with CLDR. That will probably require some code refactoring. > If it is not possible to fix this easily, it would be nice if in the > meantime at least the languages wouldn't be misreported. If a code is > "unknown" it should be possible to create a dummy > Horde_Nls_Translation object and just have the language code as > output. > > [1] <https://github.com/horde/Nls/blob/master/lib/Horde/Nls.php#L280> > [2] <https://datatracker.ietf.org/doc/html/rfc3282> > [3] <https://datatracker.ietf.org/doc/html/rfc3066>
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers