summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-05-16 22:52:28 -0400
committerDessalines <tyhou13@gmx.com>2020-05-16 22:52:28 -0400
commit6fe4184f72ca39011a62c8df572ae419a1288334 (patch)
treed699e54851b05a78e21d1e7bab72d0d97b70b384
parentd2e38b106229360994bb94ac5cb783d9b4707e25 (diff)
Adding Greek and Basque languages for weblate.
-rw-r--r--server/src/rate_limit/mod.rs2
-rw-r--r--server/src/websocket/server.rs2
-rw-r--r--ui/src/i18next.ts4
-rw-r--r--ui/src/utils.ts8
-rw-r--r--ui/translations/el.json1
-rw-r--r--ui/translations/eu.json1
6 files changed, 16 insertions, 2 deletions
diff --git a/server/src/rate_limit/mod.rs b/server/src/rate_limit/mod.rs
index fec8a569..8d698b78 100644
--- a/server/src/rate_limit/mod.rs
+++ b/server/src/rate_limit/mod.rs
@@ -92,7 +92,7 @@ impl RateLimited {
}
RateLimitType::Post => {
limiter.check_rate_limit_full(
- self.type_.clone(),
+ self.type_,
&ip_addr,
rate_limit.post,
rate_limit.post_per_second,
diff --git a/server/src/websocket/server.rs b/server/src/websocket/server.rs
index da5098e9..25766011 100644
--- a/server/src/websocket/server.rs
+++ b/server/src/websocket/server.rs
@@ -940,7 +940,7 @@ impl Handler<Connect> for ChatServer {
id,
SessionInfo {
addr: msg.addr,
- ip: msg.ip.to_owned(),
+ ip: msg.ip,
},
);
diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts
index 2cd29000..f2b8c10e 100644
--- a/ui/src/i18next.ts
+++ b/ui/src/i18next.ts
@@ -1,6 +1,8 @@
import i18next from 'i18next';
import { getLanguage } from './utils';
import { en } from './translations/en';
+import { el } from './translations/el';
+import { eu } from './translations/eu';
import { eo } from './translations/eo';
import { es } from './translations/es';
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
const resources = {
en,
+ el,
+ eu,
eo,
es,
ka,
diff --git a/ui/src/utils.ts b/ui/src/utils.ts
index f18d996e..69afc7a4 100644
--- a/ui/src/utils.ts
+++ b/ui/src/utils.ts
@@ -1,4 +1,6 @@
import 'moment/locale/es';
+import 'moment/locale/el';
+import 'moment/locale/eu';
import 'moment/locale/eo';
import 'moment/locale/de';
import 'moment/locale/zh-cn';
@@ -59,6 +61,8 @@ export const mentionDropdownFetchLimit = 10;
export const languages = [
{ code: 'ca', name: 'Català' },
{ code: 'en', name: 'English' },
+ { code: 'el', name: 'Ελληνικά' },
+ { code: 'eu', name: 'Euskara' },
{ code: 'eo', name: 'Esperanto' },
{ code: 'es', name: 'Español' },
{ code: 'de', name: 'Deutsch' },
@@ -370,6 +374,10 @@ export function getMomentLanguage(): string {
lang = 'ka';
} else if (lang.startsWith('hi')) {
lang = 'hi';
+ } else if (lang.startsWith('el')) {
+ lang = 'el';
+ } else if (lang.startsWith('eu')) {
+ lang = 'eu';
} else {
lang = 'en';
}
diff --git a/ui/translations/el.json b/ui/translations/el.json
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/ui/translations/el.json
@@ -0,0 +1 @@
+{}
diff --git a/ui/translations/eu.json b/ui/translations/eu.json
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/ui/translations/eu.json
@@ -0,0 +1 @@
+{}