Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalmi committed Apr 16, 2023
1 parent 53e5662 commit 71e8def
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 40 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"glob": "^9.2.1",
"glob": "^10.1.0",
"jest": "^29.5.0",
"jest-preset-preact": "^4.0.5",
"preact-cli": "^3.4.5",
Expand Down
28 changes: 26 additions & 2 deletions scripts/TranslationsToCsv.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
import fs from 'fs';
import glob from 'glob';
import { glob } from 'glob';
import { AVAILABLE_LANGUAGE_KEYS } from '../src/js/translations/Translation.mjs';

const EXTRA_KEYS = [
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
'saturday',
'sunday',
'today',
'yesterday',
'global_feed',
'messages',
'feeds',
'social_network',
'content',
'images',
'audio',
'videos',
'autoplay_videos',
'playback',
'embeds',
'everyone',
];

async function translationsToCsv() {
let csv = '';
let languages = [];
Expand Down Expand Up @@ -29,7 +53,7 @@ async function translationsToCsv() {
console.log('found', translationKeys.size, 'translation keys from', files.length, 'files');

// Translation keys from variables are not found by the regex above
['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'today', 'yesterday', 'global_feed', 'messages'].forEach((key) => {
EXTRA_KEYS.forEach((key) => {
translationKeys.add(key);
});
translationKeys = Array.from(translationKeys);
Expand Down
13 changes: 1 addition & 12 deletions src/js/translations/pt-BR.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export default {
"about": "Sobre",
"account": "Conta",
"add": "Adicionar",
"add_contact_or_create_group": "Adicionar Contato ou Criar Grupo",
"alternatively": "Alternativamente",
"appearance": "Aparência",
"application_security_warning": "Alerta de segurança",
Expand All @@ -12,7 +11,6 @@ export default {
"block": "Bloquear",
"blocked": "Bloqueado",
"blocked_users": "Usuários bloqueados",
"cancel": "Cancelar",
"color_scheme": "Esquema de cor",
"connected_relays": "Relays conectados",
"copied": "Copiado",
Expand All @@ -21,7 +19,6 @@ export default {
"copy_note_ID": "Copiar ID da nota",
"copy_raw_data": "Copiar dados brutos",
"copy_user_ID": "Copiar",
"create": "Criar",
"dark": "Escuro",
"delete": "Apagar",
"done": "Feito",
Expand All @@ -39,11 +36,8 @@ export default {
"get_notified_new_messages": "Ser notificado de novas mensagens",
"give_your_profile_link_to_someone": "dar seu link de perfil para alguém",
"global_feed": "Feed global",
"group_name": "Nome do grupo",
"have_someones_invite_link": "Tem o link de bate-papo de alguém?",
"install_lightning_wallet_prompt": "Por favor, instale uma carteira lightning como getalby.com (desktop) ou walletofsatoshi.com (mobile)!",
"language": "Idioma",
"last_active": "Última atividade",
"light": "Claro",
"likes": "Gostei",
"load": "Carregar",
Expand All @@ -55,8 +49,6 @@ export default {
"messages": "Mensagens",
"monday": "Segunda-feira",
"network": "Rede",
"new_chat": "Nova conversa",
"new_group": "Novo grupo",
"new_relay_url": "Nova url de relay",
"new_user_go": "Vai",
"no_followers_yet": "Não segue ainda",
Expand All @@ -66,11 +58,9 @@ export default {
"nostr_extension_login": "Login da extensão nostr",
"note_to_self": "Nota pessoal",
"now": "agora",
"online": "online",
"otherwise_cant_log_in_again": "Ou então não conseguirá logar novamente",
"paste_event_json": "Cole aqui o JSON do evento",
"paste_private_key": "Cole a chave privada",
"paste_their_invite_link": "Cole o link da outra pessoa",
"peers": "Peers",
"playback": "Reprodução",
"post": "Post",
Expand All @@ -92,11 +82,10 @@ export default {
"type_a_message": "Digite uma mensagem",
"typing": "Digitando...",
"unblock": "Desbloquear",
"use_picture": "Usar foto",
"video_call": "Chamada de vídeo",
"view_as": "Ver como",
"wednesday": "Quarta-feira",
"whats_your_name": "Qual o seu nome?",
"yesterday": "ontem",
"your_events": "Os seus eventos"
};
};
55 changes: 30 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6003,6 +6003,16 @@ glob-parent@^6.0.2:
dependencies:
is-glob "^4.0.3"

glob@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/glob/-/glob-10.1.0.tgz#baa48c6a157cfa34ca7887f2a29c6156bc6b65f8"
integrity sha512-daGobsYuT0G4hng24B5LbeLNvwKZYRhWyDl3RvqqAGZjJnCopWWK6PWnAGBY1M/vdA63QE+jddhZcYp+74Bq6Q==
dependencies:
fs.realpath "^1.0.0"
minimatch "^9.0.0"
minipass "^5.0.0"
path-scurry "^1.7.0"

glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
Expand All @@ -6026,16 +6036,6 @@ glob@^8.0.3:
minimatch "^5.0.1"
once "^1.3.0"

glob@^9.2.1:
version "9.2.1"
resolved "https://registry.yarnpkg.com/glob/-/glob-9.2.1.tgz#f47e34e1119e7d4f93a546e75851ba1f1e68de50"
integrity sha512-Pxxgq3W0HyA3XUvSXcFhRSs+43Jsx0ddxcFrbjxNGkL2Ak5BAUBxLqI5G6ADDeCHLfzzXFhe0b1yYcctGmytMA==
dependencies:
fs.realpath "^1.0.0"
minimatch "^7.4.1"
minipass "^4.2.4"
path-scurry "^1.6.1"

global-dirs@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.1.tgz#0c488971f066baceda21447aecb1a8b911d22485"
Expand Down Expand Up @@ -8081,10 +8081,10 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"

lru-cache@^7.14.1:
version "7.18.3"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89"
integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==
lru-cache@^9.0.0:
version "9.0.3"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.0.3.tgz#8a04f282df5320227bb7215c55df2660d3e4e25b"
integrity sha512-cyjNRew29d4kbgnz1sjDqxg7qg8NW4s+HQzCGjeon7DV5T2yDije16W9HaUFV1dhVEMh+SjrOcK0TomBmf3Egg==

lru@^3.1.0:
version "3.1.0"
Expand Down Expand Up @@ -8340,10 +8340,10 @@ minimatch@^5.0.1:
dependencies:
brace-expansion "^2.0.1"

minimatch@^7.4.1:
version "7.4.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.2.tgz#157e847d79ca671054253b840656720cb733f10f"
integrity sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==
minimatch@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.0.tgz#bfc8e88a1c40ffd40c172ddac3decb8451503b56"
integrity sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==
dependencies:
brace-expansion "^2.0.1"

Expand Down Expand Up @@ -8388,11 +8388,16 @@ minipass@^3.0.0, minipass@^3.1.1:
dependencies:
yallist "^4.0.0"

minipass@^4.0.0, minipass@^4.0.2, minipass@^4.2.4:
minipass@^4.0.0:
version "4.2.4"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.4.tgz#7d0d97434b6a19f59c5c3221698b48bbf3b2cd06"
integrity sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==

minipass@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d"
integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==

minizlib@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d"
Expand Down Expand Up @@ -9178,13 +9183,13 @@ path-parse@^1.0.7:
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==

path-scurry@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.6.1.tgz#dab45f7bb1d3f45a0e271ab258999f4ab7e23132"
integrity sha512-OW+5s+7cw6253Q4E+8qQ/u1fVvcJQCJo/VFD8pje+dbJCF1n5ZRMV2AEHbGp+5Q7jxQIYJxkHopnj6nzdGeZLA==
path-scurry@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.7.0.tgz#99c741a2cfbce782294a39994d63748b5a24f6db"
integrity sha512-UkZUeDjczjYRE495+9thsgcVgsaCPkaw80slmfVFgllxY+IO8ubTsOpFVjDPROBqJdHfVPUFRHPBV/WciOVfWg==
dependencies:
lru-cache "^7.14.1"
minipass "^4.0.2"
lru-cache "^9.0.0"
minipass "^5.0.0"

[email protected]:
version "0.1.7"
Expand Down

0 comments on commit 71e8def

Please sign in to comment.