summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-05-01 21:51:04 -0400
committerDessalines <tyhou13@gmx.com>2020-05-01 21:51:04 -0400
commit43592c32d9c4190ee7ef26838f8f33c555a72997 (patch)
tree2d3ce75605b88bd62c16c64bca3e66e0903d79d3
parent9b93d4c098da53cc24ca0b4df293122ef251f7d3 (diff)
Adding hindi template.
-rw-r--r--ui/src/i18next.ts4
-rw-r--r--ui/src/utils.ts14
-rw-r--r--ui/translations/hi.json3
3 files changed, 16 insertions, 5 deletions
diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts
index 85d06f91..2cd29000 100644
--- a/ui/src/i18next.ts
+++ b/ui/src/i18next.ts
@@ -13,14 +13,18 @@ import { it } from './translations/it';
import { fi } from './translations/fi';
import { ca } from './translations/ca';
import { fa } from './translations/fa';
+import { hi } from './translations/hi';
import { pt_BR } from './translations/pt_BR';
import { ja } from './translations/ja';
+import { ka } from './translations/ka';
// https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
const resources = {
en,
eo,
es,
+ ka,
+ hi,
de,
zh,
fr,
diff --git a/ui/src/utils.ts b/ui/src/utils.ts
index 21a7fef8..2256a0c1 100644
--- a/ui/src/utils.ts
+++ b/ui/src/utils.ts
@@ -13,6 +13,7 @@ import 'moment/locale/fa';
import 'moment/locale/pt-br';
import 'moment/locale/ja';
import 'moment/locale/ka';
+import 'moment/locale/hi';
import {
UserOperation,
@@ -62,6 +63,7 @@ export const languages = [
{ code: 'es', name: 'Español' },
{ code: 'de', name: 'Deutsch' },
{ code: 'ka', name: 'ქართული ენა' },
+ { code: 'hi', name: 'मानक हिन्दी' },
{ code: 'fa', name: 'فارسی' },
{ code: 'ja', name: '日本語' },
{ code: 'pt_BR', name: 'Português Brasileiro' },
@@ -118,11 +120,11 @@ export const md = new markdown_it({
typographer: true,
})
.use(markdown_it_container, 'spoiler', {
- validate: function(params: any) {
+ validate: function (params: any) {
return params.trim().match(/^spoiler\s+(.*)$/);
},
- render: function(tokens: any, idx: any) {
+ render: function (tokens: any, idx: any) {
var m = tokens[idx].info.trim().match(/^spoiler\s+(.*)$/);
if (tokens[idx].nesting === 1) {
@@ -138,7 +140,7 @@ export const md = new markdown_it({
defs: objectFlip(emojiShortName),
});
-md.renderer.rules.emoji = function(token, idx) {
+md.renderer.rules.emoji = function (token, idx) {
return twemoji.parse(token[idx].content);
};
@@ -284,7 +286,7 @@ export function debounce(
let timeout: any;
// Calling debounce returns a new anonymous function
- return function() {
+ return function () {
// reference the context and args for the setTimeout function
var context = this,
args = arguments;
@@ -300,7 +302,7 @@ export function debounce(
clearTimeout(timeout);
// Set the new timeout
- timeout = setTimeout(function() {
+ timeout = setTimeout(function () {
// Inside the timeout function, clear the timeout variable
// which will let the next execution run when in 'immediate' mode
timeout = null;
@@ -366,6 +368,8 @@ export function getMomentLanguage(): string {
lang = 'ja';
} else if (lang.startsWith('ka')) {
lang = 'ka';
+ } else if (lang.startsWith('hi')) {
+ lang = 'hi';
} else {
lang = 'en';
}
diff --git a/ui/translations/hi.json b/ui/translations/hi.json
new file mode 100644
index 00000000..0db3279e
--- /dev/null
+++ b/ui/translations/hi.json
@@ -0,0 +1,3 @@
+{
+
+}