summaryrefslogtreecommitdiffstats
path: root/ui/src/utils.ts
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-06-09 22:43:28 -0400
committerDessalines <tyhou13@gmx.com>2020-06-09 22:43:28 -0400
commitda2229a3033d5f14bf1a6bce34d98f2a0680cd43 (patch)
tree3bdda9cfb1a5916fff2f98b5675a8b3aed928cee /ui/src/utils.ts
parent2e4c7256476e4d5c79f43c9c86c6c8dc3c6965af (diff)
parenta13e9fe3959e07f901ba0647dfd7f749865a900d (diff)
Merge branch 'master' into dev
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r--ui/src/utils.ts42
1 files changed, 33 insertions, 9 deletions
diff --git a/ui/src/utils.ts b/ui/src/utils.ts
index 82900cab..81bb0147 100644
--- a/ui/src/utils.ts
+++ b/ui/src/utils.ts
@@ -12,10 +12,15 @@ import 'moment/locale/it';
import 'moment/locale/fi';
import 'moment/locale/ca';
import 'moment/locale/fa';
+import 'moment/locale/pl';
import 'moment/locale/pt-br';
import 'moment/locale/ja';
import 'moment/locale/ka';
import 'moment/locale/hi';
+import 'moment/locale/gl';
+import 'moment/locale/tr';
+import 'moment/locale/hu';
+import 'moment/locale/uk';
import {
UserOperation,
@@ -66,15 +71,20 @@ export const languages = [
{ code: 'eo', name: 'Esperanto' },
{ code: 'es', name: 'Español' },
{ code: 'de', name: 'Deutsch' },
+ { code: 'gl', name: 'Galego' },
+ { code: 'hu', name: 'Magyar Nyelv' },
{ code: 'ka', name: 'ქართული ენა' },
{ code: 'hi', name: 'मानक हिन्दी' },
{ code: 'fa', name: 'فارسی' },
{ code: 'ja', name: '日本語' },
+ { code: 'pl', name: 'Polski' },
{ code: 'pt_BR', name: 'Português Brasileiro' },
{ code: 'zh', name: '中文' },
{ code: 'fi', name: 'Suomi' },
{ code: 'fr', name: 'Français' },
{ code: 'sv', name: 'Svenska' },
+ { code: 'tr', name: 'Türkçe' },
+ { code: 'uk', name: 'українська мова' },
{ code: 'ru', name: 'Русский' },
{ code: 'nl', name: 'Nederlands' },
{ code: 'it', name: 'Italiano' },
@@ -366,6 +376,8 @@ export function getMomentLanguage(): string {
lang = 'ca';
} else if (lang.startsWith('fa')) {
lang = 'fa';
+ } else if (lang.startsWith('pl')) {
+ lang = 'pl';
} else if (lang.startsWith('pt')) {
lang = 'pt-br';
} else if (lang.startsWith('ja')) {
@@ -378,6 +390,14 @@ export function getMomentLanguage(): string {
lang = 'el';
} else if (lang.startsWith('eu')) {
lang = 'eu';
+ } else if (lang.startsWith('gl')) {
+ lang = 'gl';
+ } else if (lang.startsWith('tr')) {
+ lang = 'tr';
+ } else if (lang.startsWith('hu')) {
+ lang = 'hu';
+ } else if (lang.startsWith('uk')) {
+ lang = 'uk';
} else {
lang = 'en';
}
@@ -863,14 +883,18 @@ export function previewLines(text: string, lines: number = 3): string {
}
function canUseWebP() {
- var elem = document.createElement('canvas');
-
- if (!!(elem.getContext && elem.getContext('2d'))) {
- var testString = !(window.mozInnerScreenX == null) ? 'png' : 'webp';
- // was able or not to get WebP representation
- return elem.toDataURL('image/webp').startsWith('data:image/' + testString);
- }
-
- // very old browser like IE 8, canvas not supported
+ // TODO pictshare might have a webp conversion bug, try disabling this
return false;
+
+ // var elem = document.createElement('canvas');
+ // if (!!(elem.getContext && elem.getContext('2d'))) {
+ // var testString = !(window.mozInnerScreenX == null) ? 'png' : 'webp';
+ // // was able or not to get WebP representation
+ // return (
+ // elem.toDataURL('image/webp').startsWith('data:image/' + testString)
+ // );
+ // }
+
+ // // very old browser like IE 8, canvas not supported
+ // return false;
}