Adding Greek and Basque languages for weblate.

This commit is contained in:
Dessalines 2020-05-16 22:52:28 -04:00
parent d2e38b1062
commit 6fe4184f72
6 changed files with 16 additions and 2 deletions

View File

@ -92,7 +92,7 @@ impl RateLimited {
} }
RateLimitType::Post => { RateLimitType::Post => {
limiter.check_rate_limit_full( limiter.check_rate_limit_full(
self.type_.clone(), self.type_,
&ip_addr, &ip_addr,
rate_limit.post, rate_limit.post,
rate_limit.post_per_second, rate_limit.post_per_second,

View File

@ -940,7 +940,7 @@ impl Handler<Connect> for ChatServer {
id, id,
SessionInfo { SessionInfo {
addr: msg.addr, addr: msg.addr,
ip: msg.ip.to_owned(), ip: msg.ip,
}, },
); );

4
ui/src/i18next.ts vendored
View File

@ -1,6 +1,8 @@
import i18next from 'i18next'; import i18next from 'i18next';
import { getLanguage } from './utils'; import { getLanguage } from './utils';
import { en } from './translations/en'; import { en } from './translations/en';
import { el } from './translations/el';
import { eu } from './translations/eu';
import { eo } from './translations/eo'; import { eo } from './translations/eo';
import { es } from './translations/es'; import { es } from './translations/es';
import { de } from './translations/de'; import { de } from './translations/de';
@ -21,6 +23,8 @@ import { ka } from './translations/ka';
// https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
const resources = { const resources = {
en, en,
el,
eu,
eo, eo,
es, es,
ka, ka,

8
ui/src/utils.ts vendored
View File

@ -1,4 +1,6 @@
import 'moment/locale/es'; import 'moment/locale/es';
import 'moment/locale/el';
import 'moment/locale/eu';
import 'moment/locale/eo'; import 'moment/locale/eo';
import 'moment/locale/de'; import 'moment/locale/de';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
@ -59,6 +61,8 @@ export const mentionDropdownFetchLimit = 10;
export const languages = [ export const languages = [
{ code: 'ca', name: 'Català' }, { code: 'ca', name: 'Català' },
{ code: 'en', name: 'English' }, { code: 'en', name: 'English' },
{ code: 'el', name: 'Ελληνικά' },
{ code: 'eu', name: 'Euskara' },
{ code: 'eo', name: 'Esperanto' }, { code: 'eo', name: 'Esperanto' },
{ code: 'es', name: 'Español' }, { code: 'es', name: 'Español' },
{ code: 'de', name: 'Deutsch' }, { code: 'de', name: 'Deutsch' },
@ -370,6 +374,10 @@ export function getMomentLanguage(): string {
lang = 'ka'; lang = 'ka';
} else if (lang.startsWith('hi')) { } else if (lang.startsWith('hi')) {
lang = 'hi'; lang = 'hi';
} else if (lang.startsWith('el')) {
lang = 'el';
} else if (lang.startsWith('eu')) {
lang = 'eu';
} else { } else {
lang = 'en'; lang = 'en';
} }

1
ui/translations/el.json vendored Normal file
View File

@ -0,0 +1 @@
{}

1
ui/translations/eu.json vendored Normal file
View File

@ -0,0 +1 @@
{}