f:gentext-letters-for-language function should probably be able to return an empty sequence
Right now, if you use the Korean locale, 'ko', it will cause a runtime exception since the locale/ko.xml doesn't contain a l:letters element, if you for instance use the auto index generation feature which tries to use the letters for grouping the index.
Sorry about that. What would be the most useful thing to do for Korean in that situation?
No worries!
I have solved the most immediate problems in our customization by overriding some of the merge templates in gentext.xsl. First by examining if there is a l:letters in the custom but not in the base-locale in the match="l:l10n" template. I have also overridden the template for l:letters when merging. Since our custom override will always contain a complete set of l:l elements.
Currently we use the phonetic letter 'alphabets' for Japanese and Korean locales in combination with the @sortas attribute of d:indexterm in our customization to be able to group and sort an index when using symbols as the actual indexterm.
This is what we use right now, not sure if it's useful for more people:
Japanese:
<l:letters>
<l:l i="-1"/>
<l:l i="0">シンボル</l:l>
<l:l i="10">あ</l:l>
<l:l i="20">い</l:l>
<l:l i="30">う</l:l>
<l:l i="40">え</l:l>
<l:l i="50">お</l:l>
<l:l i="60">か</l:l>
<l:l i="70">が</l:l>
<l:l i="80">き</l:l>
<l:l i="90">ぎ</l:l>
<l:l i="100">く</l:l>
<l:l i="110">ぐ</l:l>
<l:l i="120">け</l:l>
<l:l i="130">げ</l:l>
<l:l i="140">こ</l:l>
<l:l i="150">ご</l:l>
<l:l i="160">さ</l:l>
<l:l i="170">ざ</l:l>
<l:l i="180">し</l:l>
<l:l i="190">じ</l:l>
<l:l i="200">す</l:l>
<l:l i="210">ず</l:l>
<l:l i="220">せ</l:l>
<l:l i="230">ぜ</l:l>
<l:l i="240">そ</l:l>
<l:l i="250">ぞ</l:l>
<l:l i="260">た</l:l>
<l:l i="270">だ</l:l>
<l:l i="280">ち</l:l>
<l:l i="290">ぢ</l:l>
<l:l i="300">つ</l:l>
<l:l i="310">づ</l:l>
<l:l i="320">て</l:l>
<l:l i="330">で</l:l>
<l:l i="340">と</l:l>
<l:l i="350">ど</l:l>
<l:l i="360">な</l:l>
<l:l i="370">に</l:l>
<l:l i="380">ぬ</l:l>
<l:l i="390">ね</l:l>
<l:l i="400">の</l:l>
<l:l i="410">は</l:l>
<l:l i="420">ば</l:l>
<l:l i="430">ぱ</l:l>
<l:l i="440">ひ</l:l>
<l:l i="450">び</l:l>
<l:l i="460">ぴ</l:l>
<l:l i="470">ふ</l:l>
<l:l i="480">ぶ</l:l>
<l:l i="490">ぷ</l:l>
<l:l i="500">へ</l:l>
<l:l i="510">べ</l:l>
<l:l i="520">ぺ</l:l>
<l:l i="530">ほ</l:l>
<l:l i="540">ぼ</l:l>
<l:l i="550">ぽ</l:l>
<l:l i="560">ま</l:l>
<l:l i="570">み</l:l>
<l:l i="580">む</l:l>
<l:l i="590">め</l:l>
<l:l i="600">も</l:l>
<l:l i="610">や</l:l>
<l:l i="620">ゆ</l:l>
<l:l i="630">よ</l:l>
<l:l i="640">ら</l:l>
<l:l i="650">り</l:l>
<l:l i="660">る</l:l>
<l:l i="670">れ</l:l>
<l:l i="680">ろ</l:l>
<l:l i="690">わ</l:l>
<l:l i="700">を</l:l>
<l:l i="710">ん</l:l>
</l:letters>
Korean:
<l:letters>
<l:l i="-1"/>
<l:l i="0">기호</l:l>
<l:l i="10">ㄱ</l:l>
<l:l i="20">ㄲ</l:l>
<l:l i="30">ㄴ</l:l>
<l:l i="40">ㄷ</l:l>
<l:l i="50">ㄸ</l:l>
<l:l i="60">ㄹ</l:l>
<l:l i="70">ㅁ</l:l>
<l:l i="80">ㅂ</l:l>
<l:l i="90">ㅃ</l:l>
<l:l i="100">ㅅ</l:l>
<l:l i="110">ㅆ</l:l>
<l:l i="120">ㅇ</l:l>
<l:l i="130">ㅈ</l:l>
<l:l i="140">ㅉ</l:l>
<l:l i="150">ㅊ</l:l>
<l:l i="160">ㅋ</l:l>
<l:l i="170">ㅌ</l:l>
<l:l i="180">ㅍ</l:l>
<l:l i="190">ㅎ</l:l>
<l:l i="200">ㅏ</l:l>
<l:l i="210">ㅐ</l:l>
<l:l i="220">ㅑ</l:l>
<l:l i="230">ㅒ</l:l>
<l:l i="240">ㅓ</l:l>
<l:l i="250">ㅔ</l:l>
<l:l i="260">ㅕ</l:l>
<l:l i="270">ㅖ</l:l>
<l:l i="280">ㅗ</l:l>
<l:l i="290">ㅘ</l:l>
<l:l i="300">ㅙ</l:l>
<l:l i="310">ㅚ</l:l>
<l:l i="320">ㅛ</l:l>
<l:l i="330">ㅜ</l:l>
<l:l i="340">ㅝ</l:l>
<l:l i="350">ㅞ</l:l>
<l:l i="360">ㅟ</l:l>
<l:l i="370">ㅠ</l:l>
<l:l i="380">ㅡ</l:l>
<l:l i="390">ㅢ</l:l>
<l:l i="400">ㅣ</l:l>
</l:letters>
Doing a quick search through the locales, the following languages lacks a <l:letters> element. And will thus cause a runtime exception when the f:gentext-letters-for-language() is used.
la : Latin
af : Afrikaans
ar : Arabic
vi : Vietnamese
bn : Bangla
sq : Albanian
ko : Korean
gl : Galician
sk : Slovak
ro : Romanian
he : Hebrew
eu : Basque
et : Estonian
sl : Slovenian
th : Thai
xh : Xhosa