Skip to content

Commit 69efaff

Browse files
authored
fix: missing locale keys for created_at_timestamp and updated_at_timestamp (#3721)
* fix: missing locale keys for `created_at_timestamp` and `updated_at_timestamp` * variable name fix * variable name fix * i18n-tasks check-consistent-interpolations
1 parent 4898fc5 commit 69efaff

19 files changed

+65
-0
lines changed

CONTRIBUTING.MD

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,32 @@ To keep track of the schema structure for the models, run `annotate --models --e
224224
## Using VSCode?
225225

226226
We compiled [an extension pack](https://marketplace.visualstudio.com/items?itemName=adrianthedev.vsruby) with a few extensions that should help you with Ruby development. We use them with Avo.
227+
228+
## Adding I18n Keys
229+
230+
When incorporating I18n keys, such as `avo.preview`, it's important to ensure that all locale files include the key with appropriate translations.
231+
232+
### Step 1: Add and Normalize
233+
First, add the key to the `avo.en.yml` file. Then, run the following command to normalize the locale files alphabetically:
234+
```bash
235+
i18n-tasks normalize
236+
```
237+
238+
### Step 2: Adding Missing Keys with or without Translation
239+
240+
When adding missing keys, you have two options: proceed without translation or automatically translate them using OpenAI.
241+
242+
#### Option 1: Add Missing Keys Without Translation
243+
Run the following command to add the missing keys to all locale files:
244+
```bash
245+
i18n-tasks add-missing
246+
```
247+
This will populate the missing keys but retain the original label without translations applied.
248+
249+
#### Option 2: Add and Automatically Translate Missing Keys
250+
If you prefer to automatically translate the missing keys, skip the previous step and execute this command with your OpenAI API token:
251+
```bash
252+
OPENAI_API_KEY=TOKEN bundle exec i18n-tasks translate-missing --backend=openai
253+
```
254+
255+
Replace `TOKEN` with your actual OpenAI API key. This step will both add the missing keys and translate them automatically.

lib/generators/avo/templates/locales/avo.ar.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ar:
3333
confirm: تأكيد
3434
copy: نسخ
3535
create_new_item: إنشاء %{item} جديد
36+
created_at_timestamp: تم الإنشاء في %{created_at}
3637
dashboard: لوحة القيادة
3738
dashboards: لوحات القيادة
3839
default_scope: الجميع
@@ -126,6 +127,7 @@ ar:
126127
type_to_search: اكتب للبحث.
127128
unauthorized: غير مصرح به
128129
undo: تراجع
130+
updated_at_timestamp: تم التحديث في %{updated_at}
129131
view: عرض
130132
view_item: عرض %{item}
131133
visit_record_on_external_path: زيارة السجل على الرابط الخارجي

lib/generators/avo/templates/locales/avo.de.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ de:
2727
confirm: Bestätigen
2828
copy: Kopieren
2929
create_new_item: Neues %{item} erstellen
30+
created_at_timestamp: Erstellt am %{created_at}
3031
dashboard: Dashboard
3132
dashboards: Dashboards
3233
default_scope: Alle
@@ -116,6 +117,7 @@ de:
116117
type_to_search: Tippen, um zu suchen.
117118
unauthorized: Nicht autorisiert
118119
undo: Rückgängig machen
120+
updated_at_timestamp: Aktualisiert am %{updated_at}
119121
view: Anzeigen
120122
view_item: "%{item} anzeigen"
121123
visit_record_on_external_path: Datensatz über externen Link besuchen

lib/generators/avo/templates/locales/avo.en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ en:
2727
confirm: Confirm
2828
copy: Copy
2929
create_new_item: Create new %{item}
30+
created_at_timestamp: Created at %{created_at}
3031
dashboard: Dashboard
3132
dashboards: Dashboards
3233
default_scope: All
@@ -116,6 +117,7 @@ en:
116117
type_to_search: Type to search.
117118
unauthorized: Unauthorized
118119
undo: undo
120+
updated_at_timestamp: Updated at %{updated_at}
119121
view: View
120122
view_item: view %{item}
121123
visit_record_on_external_path: Visit record on external path

lib/generators/avo/templates/locales/avo.es.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ es:
2929
confirm: Confirmar
3030
copy: Copiar
3131
create_new_item: Crear nuevo/a %{item}
32+
created_at_timestamp: Creado en %{created_at}
3233
dashboard: Panel
3334
dashboards: Paneles
3435
default_scope: Todos
@@ -118,6 +119,7 @@ es:
118119
type_to_search: Escribe para buscar.
119120
unauthorized: No autorizado
120121
undo: deshacer
122+
updated_at_timestamp: Actualizado en %{updated_at}
121123
view: Vista
122124
view_item: ver %{item}
123125
visit_record_on_external_path: Visitar registro en enlace externo

lib/generators/avo/templates/locales/avo.fr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ fr:
2929
confirm: Confirmer
3030
copy: Copier
3131
create_new_item: Créer un nouveau %{item}
32+
created_at_timestamp: Créé le %{created_at}
3233
dashboard: Tableau de bord
3334
dashboards: Tableaux de bord
3435
default_scope: Tout
@@ -118,6 +119,7 @@ fr:
118119
type_to_search: Type à rechercher.
119120
unauthorized: Non autorisé
120121
undo: annuler
122+
updated_at_timestamp: Mis à jour le %{updated_at}
121123
view: Vue
122124
view_item: voir %{item}
123125
visit_record_on_external_path: Consulter l'enregistrement via un lien externe

lib/generators/avo/templates/locales/avo.it.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ it:
2727
confirm: Conferma
2828
copy: Copia
2929
create_new_item: Crea nuovo %{item}
30+
created_at_timestamp: Creato il %{created_at}
3031
dashboard: Cruscotto
3132
dashboards: Cruscotti
3233
default_scope: Tutti
@@ -116,6 +117,7 @@ it:
116117
type_to_search: Digita per cercare.
117118
unauthorized: Non autorizzato
118119
undo: Annulla
120+
updated_at_timestamp: Aggiornato il %{updated_at}
119121
view: Visualizza
120122
view_item: Visualizza %{item}
121123
visit_record_on_external_path: Visita il record tramite link esterno

lib/generators/avo/templates/locales/avo.ja.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ja:
2929
confirm: 確認
3030
copy: コピー
3131
create_new_item: 新しい%{item}を作成
32+
created_at_timestamp: "%{created_at}で作成"
3233
dashboard: ダッシュボード
3334
dashboards: ダッシュボード
3435
default_scope: 全て
@@ -118,6 +119,7 @@ ja:
118119
type_to_search: 検索する内容を入力してください。
119120
unauthorized: 許可されていません
120121
undo: 元に戻す
122+
updated_at_timestamp: "%{updated_at}で更新"
121123
view: ビュー
122124
view_item: "%{item}を表示"
123125
visit_record_on_external_path: 外部リンクで記録を確認する

lib/generators/avo/templates/locales/avo.nb.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ nb:
2929
confirm: Bekreft
3030
copy: Kopier
3131
create_new_item: Lag ny %{item}
32+
created_at_timestamp: Opprettet den %{created_at}
3233
dashboard: Dashboard
3334
dashboards: Dashboards
3435
default_scope: Alle
@@ -118,6 +119,7 @@ nb:
118119
type_to_search: Søk.
119120
unauthorized: Ikke autorisert
120121
undo: angre
122+
updated_at_timestamp: Oppdatert den %{updated_at}
121123
view: Vis
122124
view_item: vis %{item}
123125
visit_record_on_external_path: Besøk posten via en ekstern lenke

lib/generators/avo/templates/locales/avo.nl.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ nl:
2727
confirm: Bevestigen
2828
copy: Kopie
2929
create_new_item: Nieuw %{item} aanmaken
30+
created_at_timestamp: Aangemaakt op %{created_at}
3031
dashboard: Dashboard
3132
dashboards: Dashboards
3233
default_scope: Alle
@@ -116,6 +117,7 @@ nl:
116117
type_to_search: Typ om te zoeken.
117118
unauthorized: Niet geautoriseerd
118119
undo: Ongedaan maken
120+
updated_at_timestamp: Bijgewerkt op %{updated_at}
119121
view: Bekijken
120122
view_item: "%{item} bekijken"
121123
visit_record_on_external_path: Bezoek record via een externe link

0 commit comments

Comments
 (0)