Warning, file /frameworks/ki18n/po/ko/scripts/ki18n6/ki18n6.js was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // kdelibs4.js of Korean KDE translation
0002 // This script is distributed under GNU General Public License, version 2 or later.
0003 // Copyright (C) Chusslove Ilich, 2007. (for strip accelerator part)
0004 // Copyright (C) Park Shinjo, 2007. (rest of all)
0005 //
0006 
0007 stripAccRx = /\((&|&)?[a-zA-Z0-9]\)/;
0008 lstJosa = [["가","이","이(가)",false],
0009            ["를","을","을(를)",false],
0010            ["는","은","은(는)",false],
0011            ["와","과","과(와)",false],
0012            ["","이","(이)",false],
0013            ["","으","(으)", true]];
0014 
0015 // *** Detect the provided word is Hangeul.
0016 function isHangeul(code)
0017 {
0018     if (code >= 0xac00 && code <= 0xd7af) return true;
0019     else return false;
0020 }
0021 
0022 // *** Strip the accelerator marker, composed of an ASCII alphanumeric
0023 // within parenthesis (with or without an ampersand in front).
0024 function stripAccelerator(phrase)
0025 {
0026     return phrase.replace(stripAccRx, "");
0027 }
0028 
0029 // *** Detect the phrase has 종성(Final jamo). It will be used in
0030 // detection of 을/를, 이/가.
0031 function getFinalJamoType(phrase, rieul)
0032 {
0033     var code = phrase.charCodeAt(phrase.length - 1);
0034     if (!isHangeul(code)) return 2;
0035     code -= 0xac00;
0036     code %= 28;
0037     if (rieul && code == 8) return 0;
0038     switch (code) {
0039     case 0:
0040         return 0;
0041     default:
0042         return 1;
0043     }
0044 }
0045 
0046 // Functions in below attach appropriate 조사 (postposition)
0047 // according to the word. It only affects Hangeul, if non-Hangeul
0048 // word is provided, then fallback string is used.
0049 function attachJosa(type, phrase)
0050 {
0051     var i = getFinalJamoType(phrase, lstJosa[type][3]);
0052     return lstJosa[type][i];
0053 }
0054 
0055 function attachIGa(phrase)
0056 {
0057     return attachJosa(0, phrase);
0058 }
0059 
0060 function attachEulReul(phrase)
0061 {
0062     return attachJosa(1, phrase);
0063 }
0064 
0065 function attachEunNeun(phrase)
0066 {
0067     return attachJosa(2, phrase);
0068 }
0069 
0070 function attachWaGwa(phrase)
0071 {
0072     return attachJosa(3, phrase);
0073 }
0074 
0075 function attachI(phrase)
0076 {
0077     return attachJosa(4, phrase);
0078 }
0079 
0080 function attachEu(phrase)
0081 {
0082     return attachJosa(5, phrase);
0083 }
0084 
0085 
0086 // ==> Exports to PO calls
0087 Ts.setcall("~stripAccel", stripAccelerator);
0088 Ts.setcall("을를", attachEulReul);
0089 Ts.setcall("이가", attachIGa);
0090 Ts.setcall("은는", attachEunNeun);
0091 Ts.setcall("와과", attachWaGwa);
0092 Ts.setcall("이", attachI);
0093 Ts.setcall("으", attachEu);