Skip to content

Commit

Permalink
Albanian Language Support (#719)
Browse files Browse the repository at this point in the history
Co-authored-by: Orlando Karamani <[email protected]>
  • Loading branch information
orlandokaramani and Orlando Karamani committed Sep 14, 2023
1 parent ab7ff25 commit 1b38200
Show file tree
Hide file tree
Showing 7 changed files with 799 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ RUN apt-get update && \
tesseract-ocr-tha \
tesseract-ocr-tur \
tesseract-ocr-ukr \
tesseract-ocr-vie && \
tesseract-ocr-vie \
tesseract-ocr-sqi && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
mkdir /app && \
cd /app && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Constants {
/**
* Supported document languages.
*/
public static final List<String> SUPPORTED_LANGUAGES = Lists.newArrayList("eng", "fra", "ita", "deu", "spa", "por", "pol", "rus", "ukr", "ara", "hin", "chi_sim", "chi_tra", "jpn", "tha", "kor", "nld", "tur", "heb", "hun", "fin", "swe", "lav", "dan", "nor", "vie", "ces");
public static final List<String> SUPPORTED_LANGUAGES = Lists.newArrayList("eng", "fra", "ita", "deu", "spa", "por", "pol", "rus", "ukr", "ara", "hin", "chi_sim", "chi_tra", "jpn", "tha", "kor", "nld", "tur", "heb", "hun", "fin", "swe", "lav", "dan", "nor", "vie", "ces", "sqi");

/**
* Base URL environment variable.
Expand Down
5 changes: 3 additions & 2 deletions docs-web/src/main/webapp/src/app/docs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ angular.module('docs',
prefix: 'locale/',
suffix: '[email protected]@'
})
.registerAvailableLanguageKeys(['en', 'es', 'pt', 'fr', 'de', 'el', 'ru', 'it', 'pl', 'zh_CN', 'zh_TW'], {
.registerAvailableLanguageKeys(['en', 'es', 'pt', 'fr', 'de', 'el', 'ru', 'it', 'pl', 'zh_CN', 'zh_TW', 'sq_AL'], {
'en_*': 'en',
'es_*': 'es',
'pt_*': 'pt',
Expand Down Expand Up @@ -547,7 +547,8 @@ angular.module('docs',
{ key: 'dan', label: 'Dansk' },
{ key: 'nor', label: 'Norsk' },
{ key: 'vie', label: 'Tiếng Việt' },
{ key: 'ces', label: 'Czech' }
{ key: 'ces', label: 'Czech' },
{ key: 'sqi', label: 'Shqip' }
];
})
/**
Expand Down
2 changes: 1 addition & 1 deletion docs-web/src/main/webapp/src/app/share/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ angular.module('share',
prefix: 'locale/',
suffix: '[email protected]@'
})
.registerAvailableLanguageKeys(['en', 'es', 'pt', 'fr', 'de', 'el', 'ru', 'it', 'pl', 'zh_CN', 'zh_TW'], {
.registerAvailableLanguageKeys(['en', 'es', 'pt', 'fr', 'de', 'el', 'ru', 'it', 'pl', 'zh_CN', 'zh_TW', 'sq_AL'], {
'en_*': 'en',
'es_*': 'es',
'pt_*': 'pt',
Expand Down
2 changes: 2 additions & 0 deletions docs-web/src/main/webapp/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
<span ng-switch-when="pl">Polski</span>
<span ng-switch-when="zh_CN">简体中文</span>
<span ng-switch-when="zh_TW">繁體中文</span>
<span ng-switch-when="sq_AL">Shqip</span>
</span>
<span class="caret"></span>
</a>
Expand All @@ -207,6 +208,7 @@
<li><a href ng-click="changeLanguage('pl')" ng-class="{ 'bg-info': currentLang == 'pl' }">Polski</a></li>
<li><a href ng-click="changeLanguage('zh_CN')" ng-class="{ 'bg-info': currentLang == 'zh_CN' }">简体中文</a></li>
<li><a href ng-click="changeLanguage('zh_TW')" ng-class="{ 'bg-info': currentLang == 'zh_TW' }">繁體中文</a></li>
<li><a href ng-click="changeLanguage('sq_AL')" ng-class="{ 'bg-info': currentLang == 'sq_AL' }">Shqip</a></li>
</ul>
</li>
<li translate="document.default.footer_sismics"></li>
Expand Down
150 changes: 150 additions & 0 deletions docs-web/src/main/webapp/src/locale/angular-locale_sq_AL.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}

function getVF(n, opt_precision) {
var v = opt_precision;

if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}

var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}

$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"PD",
"MD"
],
"DAY": [
"E Diel",
"E Hënë",
"E Martë",
"E Mërkurë",
"E Enjte",
"E Premte",
"E Shtunë"
],
"ERANAMES": [
"Para Krishtit",
"Pas Krishtit"
],
"ERAS": [
"p.K.",
"n.K."
],
"FIRSTDAYOFWEEK": 1,
"MONTH": [
"Janar",
"Shkurt",
"Mars",
"Prill",
"Maj",
"Qershor",
"Korrik",
"Gusht",
"Shtator",
"Tetor",
"Nëntor",
"Dhjetor"
],
"SHORTDAY": [
"Die",
"Hën",
"Mar",
"Mër",
"Enj",
"Pre",
"Sht"
],
"SHORTMONTH": [
"Jan",
"Shk",
"Mar",
"Pri",
"Maj",
"Qer",
"Kor",
"Gus",
"Sht",
"Tet",
"Nën",
"Dhj"
],
"STANDALONEMONTH": [
"Janar",
"Shkurt",
"Mars",
"Prill",
"Maj",
"Qershor",
"Korrik",
"Gusht",
"Shtator",
"Tetor",
"Nëntor",
"Dhjetor"
],
"WEEKENDRANGE": [
6,
0
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "yy-MM-dd h:mm a",
"shortDate": "yy-MM-dd",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "Lek",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-\u00a4",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "sq-al",
"localeID": "sq_AL",
"pluralCat": function(n, opt_precision) {
var i = n | 0;
var vf = getVF(n, opt_precision);
if (i == 1 && vf.v == 0) {
return PLURAL_CATEGORY.ONE;
}
return PLURAL_CATEGORY.OTHER;
}
});
}]);

0 comments on commit 1b38200

Please sign in to comment.