From 3a550b59475bb46278d05acc4645bc93828222cd Mon Sep 17 00:00:00 2001
From: Carlos Luiz <111317670+unnamed-orbert@users.noreply.github.com>
Date: Sat, 16 Nov 2024 12:32:22 -0300
Subject: [PATCH 1/2] Portuguese translate updates and locales-tool added
feat(i18n): add comprehensive localization support tool
Add a browser-based translation management tool to assist with
OldTwitter localization efforts. This tool provides:
- Side-by-side comparison of base (EN) and target translations
- Visual diff highlighting missing and extra translations
- Structural validation of locale files
- Dark/light mode support for extended usage
- JSON conversion utility for easy translation input
- Statistics dashboard showing translation progress
The tool supports all current OldTwitter locales and integrates
with the existing test.js validation system. Translators can now:
- Easily identify missing translations
- Validate JSON structure
- Convert plain text to proper locale format
- Track translation progress visually
Technical implementation:
- Pure JavaScript/HTML/CSS solution
- No external dependencies except jsdiff
- Offline-capable with static locale list
- Responsive design with accessibility considerations
Part of the ongoing effort to improve OldTwitter's
internationalization workflow.
feat(locales-tool): enhance dark mode and improve visual feedback
- Add dark mode support for diff container with semi-transparent background
- Fix contrast issues in diff section headers
- Improve visibility of added/removed status indicators
- Adjust text colors for better readability in both light/dark modes
Technical changes:
- Added specific styling for removed/added section headers
- Fixed color inheritance in dark mode
- Adjusted background opacity for better content visibility
- Maintained semantic meaning through color indicators
Note: Minor visual artifacts may occur in dark mode due to
CSS specificity, but core functionality remains intact.
---
_locales/locales-support/index.html | 587 ++++++++++++++++++++++++++++
_locales/pt_BR/messages.json | 64 ++-
_locales/readme.md | 18 +-
3 files changed, 665 insertions(+), 4 deletions(-)
create mode 100644 _locales/locales-support/index.html
diff --git a/_locales/locales-support/index.html b/_locales/locales-support/index.html
new file mode 100644
index 00000000..3b7cdb80
--- /dev/null
+++ b/_locales/locales-support/index.html
@@ -0,0 +1,587 @@
+
+
+
+
+
+
+ Locale Diff Tool
+
+
+
+
+
+
+
How to Use the Locale Diff Tool
+
+
Compare Translations:
+
+
Select your language from the dropdown menu
+
Click "Compare" to see differences with the English base version
+
The tool will show both versions side by side
+
Missing translations will be highlighted
+
+
+
Convert Text to JSON:
+
+
Use the converter box at the bottom of the page
+
Paste your text in the format: key: "value"
+
Click "Convert to JSON" to get the proper messages.json format
+
+
+
Tips:
+
+
Use the dark/light mode toggle (☀️/🌙) for better visibility
+
The comparison will show missing or different translations
+
Copy the converted JSON output to your messages.json file
+
+
+
+
+
+
Locale Diff Tool
+
+
+
+
+
+
+
+
+
English (Base)
+
+
+
+
Selected Language
+
+
+
+
+
+
+
+
Text to JSON Converter
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_locales/pt_BR/messages.json b/_locales/pt_BR/messages.json
index 07ee6132..b2567d39 100644
--- a/_locales/pt_BR/messages.json
+++ b/_locales/pt_BR/messages.json
@@ -1143,8 +1143,7 @@
"message": "Por favor copie o texto abaixo e envie-o para a $AT1$página no Github$AT2$ ou para $AT3$meu email$AT2$. Muito obrigado!",
"placeholders": {
"at1": {
- "content": ""
- },
+ "content": ""},
"at2": {
"content": ""
},
@@ -1990,9 +1989,68 @@
"anniversary_tweet": {
"message": "Você se lembra de quando ingressou no Twitter? Eu me lembro!\n#MeuAniversárioNoTwitter"
},
+
+ "advanced_search": {
+ "message": "Busca avançada"
+ },
+ "always_show_link_color": {
+ "message": "Sempre mostrar cores personalizadas para links em vez de apenas ao passar o mouse"
+ },
+ "transition_profile_banner": {
+ "message": "Usar transição no banner do perfil"
+ },
+ "custom_downloadtemplate": {
+ "message": "Modelo personalizado de download"
+ },
+ "custom_downloadtemplate_text": {
+ "message": "Permite personalizar os nomes dos arquivos ao baixar a mídia de um tweet."
+ },
+ "save_downloadtemplate": {
+ "message": "Salvar modelo de download"
+ },
+ "custom_downloadtemplate_hintName1": {
+ "message": "{user_name}: Nome do usuário."
+ },
+ "custom_downloadtemplate_hintName2": {
+ "message": "{user_screen_name}: Nome da conta do usuário. (Exemplo: @dril)"
+ },
+ "custom_downloadtemplate_hintTime": {
+ "message": "{timestamp}: Data e hora da publicação do tweet."
+ },
+ "custom_downloadtemplate_hintExtension": {
+ "message": "{extension}: Extensão do arquivo baixado do tweet."
+ },
+ "custom_downloadtemplate_hintID": {
+ "message": "{id}: ID do tweet."
+ },
+ "custom_downloadtemplate_hintIndex": {
+ "message": "{index}: Índice de cada arquivo a ser baixado. (para postagens com várias mídias)"
+ },
+ "custom_downloadtemplate_hintFilename": {
+ "message": "{filename}: Nome original do arquivo de pbs.twimg.com."
+ },
+ "nonexistent_user": {
+ "message": "Esta conta não existe"
+ },
+ "nonexistent_user_desc": {
+ "message": "Tente buscar outra."
+ },
+ "suspended_user": {
+ "message": "Conta suspensa"
+ },
+ "suspended_user_desc": {
+ "message": "O perfil que você está tentando visualizar foi suspenso."
+ },
+ "show_boring_indicators": {
+ "message": "Mostrar indicador na página de seguidores/seguindo se o último tweet da pessoa for um retweet/citação/inexistente/antigo"
+ },
+ "hide_original_languages": {
+ "message": "Ocultar idiomas originais ao traduzir"
+ },
+
"you_shared_tweet": { "message": "Você compartilhou um tweet" },
"user_shared_tweet": {
"message": "$NAME$ compartilhou um tweet",
"placeholders": { "name": { "content": "Display Name" } }
}
-}
+}
\ No newline at end of file
diff --git a/_locales/readme.md b/_locales/readme.md
index 712dac32..9dff5d17 100644
--- a/_locales/readme.md
+++ b/_locales/readme.md
@@ -2,6 +2,8 @@
Hello! I would be very thankful if you help me to translate this extension.
+### Getting Started
+
There's couple of folders here, each corresponding to language code.
If you want to translate, copy ``en`` folder (English) and paste with renaming it to your language's 2-letter country code.
@@ -10,6 +12,8 @@ If you want to translate, copy ``en`` folder (English) and paste with renaming i
Then open newly pasted folder and open ``messages.json`` in it. You'll now see ``{ "message": "some text" }`` parts in it. Then you can start translating by editing ``some text`` part!
+### Translation Guidelines
+
**Things to keep in mind:**
- Some lines have ``description``, ``example`` or ``placeholder`` fields, they are comments for translators or placeholders. You don't have to translate them.
- Pay attention to texts case and symbols in it! If English version has something in lowercase, use lowercase in translation too.
@@ -18,7 +22,19 @@ Then open newly pasted folder and open ``messages.json`` in it. You'll now see `
- Try to keep everything as short as English version, if possible (unless it's big messages).
- Some translations are ``replacer``s used in code to batch replace certain strings. Read the description before editing it!
-If you're not creating new translation, but just updating new one, you can open your languages locale file and English locale file, then copy missing lines from English file and translate them.
+### Translation Support Tools
+
+We provide a helpful tool in the `locales-support` directory to assist with translations:
+
+#### Locale Diff Tool (locales-support/index.html)
+This tool helps you:
+- Compare your translation with the English base version side by side
+- Identify missing translations
+- Convert text to proper JSON format for messages.json
+- Support dark/light mode for comfortable editing
+- Visualize differences between translations
+
+### Contributing Your Translation
When you're finished you can send me your ``messages.json file``:
- create a pull request on GitHub (preferred)
From f24a03dc29b1727d3aa1d432adc2656cbf7a5c03 Mon Sep 17 00:00:00 2001
From: Carlos Luiz <111317670+unnamed-orbert@users.noreply.github.com>
Date: Sun, 17 Nov 2024 00:43:10 -0300
Subject: [PATCH 2/2] try fix test.js erro with locales diffs
- index.html\locales-support moved to ./_locales and renamed index.html to locales-support.html,
- _locales\readme.me updated
---
_locales/locales-support.html | 587 ++++++++++++++++++++++++++++
_locales/locales-support/index.html | 587 ----------------------------
_locales/readme.md | 6 +-
3 files changed, 590 insertions(+), 590 deletions(-)
create mode 100644 _locales/locales-support.html
delete mode 100644 _locales/locales-support/index.html
diff --git a/_locales/locales-support.html b/_locales/locales-support.html
new file mode 100644
index 00000000..b494a53b
--- /dev/null
+++ b/_locales/locales-support.html
@@ -0,0 +1,587 @@
+
+
+
+
+
+
+ Locale Diff Tool
+
+
+
+
+
+
+
How to Use the Locale Diff Tool
+
+
Compare Translations:
+
+
Select your language from the dropdown menu
+
Click "Compare" to see differences with the English base version
+
The tool will show both versions side by side
+
Missing translations will be highlighted
+
+
+
Convert Text to JSON:
+
+
Use the converter box at the bottom of the page
+
Paste your text in the format: key: "value"
+
Click "Convert to JSON" to get the proper messages.json format
+
+
+
Tips:
+
+
Use the dark/light mode toggle (☀️/🌙) for better visibility
+
The comparison will show missing or different translations
+
Copy the converted JSON output to your messages.json file
+
+
+
+
+
+
Locale Diff Tool
+
+
+
+
+
+
+
+
+
English (Base)
+
+
+
+
Selected Language
+
+
+
+
+
+
+
+
Text to JSON Converter
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_locales/locales-support/index.html b/_locales/locales-support/index.html
deleted file mode 100644
index 3b7cdb80..00000000
--- a/_locales/locales-support/index.html
+++ /dev/null
@@ -1,587 +0,0 @@
-
-
-
-
-
-
- Locale Diff Tool
-
-
-
-
-
-
-
How to Use the Locale Diff Tool
-
-
Compare Translations:
-
-
Select your language from the dropdown menu
-
Click "Compare" to see differences with the English base version
-
The tool will show both versions side by side
-
Missing translations will be highlighted
-
-
-
Convert Text to JSON:
-
-
Use the converter box at the bottom of the page
-
Paste your text in the format: key: "value"
-
Click "Convert to JSON" to get the proper messages.json format
-
-
-
Tips:
-
-
Use the dark/light mode toggle (☀️/🌙) for better visibility
-
The comparison will show missing or different translations
-
Copy the converted JSON output to your messages.json file
-
-
-
-
-
-
Locale Diff Tool
-
-
-
-
-
-
-
-
-
English (Base)
-
-
-
-
Selected Language
-
-
-
-
-
-
-
-
Text to JSON Converter
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/_locales/readme.md b/_locales/readme.md
index 9dff5d17..85fbfd7e 100644
--- a/_locales/readme.md
+++ b/_locales/readme.md
@@ -24,9 +24,9 @@ Then open newly pasted folder and open ``messages.json`` in it. You'll now see `
### Translation Support Tools
-We provide a helpful tool in the `locales-support` directory to assist with translations:
+We provide a helpful tool in the `./_locales` directory to assist with translations:
-#### Locale Diff Tool (locales-support/index.html)
+#### Locale Diff Tool (./locales-support.html)
This tool helps you:
- Compare your translation with the English base version side by side
- Identify missing translations
@@ -42,4 +42,4 @@ When you're finished you can send me your ``messages.json file``:
You can also include your Twitter profile to get credited.
-Thank you!
+Thank you!
\ No newline at end of file