Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Commit 574a8e4

Browse files
authored
Update Spanish Translations + Fallback Translator (#76)
New spanish translations & added a fallback translator. *Note: not sure if the plugin name should be translated, translated it anyway*
1 parent 6f32ec9 commit 574a8e4

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

src/Localization.csv

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Key,Source,Context,Example,en_US,es_ES
2-
PluginGui_TagEditor_Title,,,,Tag Editor,Tag Editor
3-
Toolbar_InstanceTagging_Title,,,,Instance Tagging,Instance Tagging
4-
PluginButton_TagWindow_Title,,,,Tag Window,Tag Window
5-
PluginButton_TagWindow_ToolTip,,,,Manipulate CollectionService tags,Manipulate CollectionService tags
6-
PluginButton_WorldView_Title,,,,World View,World View
7-
PluginButton_WorldView_ToolTip,,,,Visualize tagged objects in the 3D view,Visualize tagged objects in the 3D view
2+
PluginGui_TagEditor_Title,,,,Tag Editor,Editor de Etiquetas
3+
Toolbar_InstanceTagging_Title,,,,Instance Tagging,Etiquetado de Instancias
4+
PluginButton_TagWindow_Title,,,,Tag Window,Ventana de Etiquetas
5+
PluginButton_TagWindow_ToolTip,,,,Manipulate CollectionService tags,Manipula etiquetas de CollectionService
6+
PluginButton_WorldView_Title,,,,World View,Vista del Mundo
7+
PluginButton_WorldView_ToolTip,,,,Visualize tagged objects in the 3D view,Visualiza objetos etiquetados en la vista 3D
88
PluginAction_ChangeIcon_Label,,,,Change icon...,Cambiar icono…
99
PluginAction_ChangeIcon_Description,,,,Change the icon of the tag.,Cambiar el icono de la etiqueta.
1010
PluginAction_ChangeGroup_Label,,,,Change group...,Cambiar grupo…
@@ -81,9 +81,9 @@ ColorPicker_HSV,,,,HSV,HSV
8181
ColorPicker_RGB,,,,RGB,RGB/RVA
8282
ColorPicker_Hex,,,,Hex,Hex
8383
TagList_AddNew,,,,Add new tag...,Agregar nueva etiqueta…
84-
TagList_AddFromSearch,,,,Add tag {Tag}...,Add tag {Tag}...
85-
TagList_ImportTag,,,,{Tag} (click to import),{Tag} (click to import)
86-
TagList_NoSearchResults,,,,No search results found.,No search results found.
84+
TagList_AddFromSearch,,,,Add tag {Tag}...,Agregar etiqueta {Tag}...
85+
TagList_ImportTag,,,,{Tag} (click to import),{Tag} (haz clic para importar)
86+
TagList_NoSearchResults,,,,No search results found.,No se han encontrado resultados para tu búsqueda..
8787
TagSettings_VisualizeAs,,,,Visualize as:,Visualizar como:
8888
TagSettings_ChangeIcon,,,,Change icon,Cambiar icono
8989
TagSettings_ChangeGroup,,,,Change group,Cambiar grupo

src/tr.lua

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,27 @@ local supportedLanguages = {
88
["es_ES"] = "es-es"
99
}
1010

11-
local function tr(key: string, args: any): string
12-
local locale = supportedLanguages[Studio.StudioLocaleId] or "en-us"
13-
local l18n = Localization:GetTranslator(locale)
11+
local defaultLocale = "en-us"
12+
local locale = supportedLanguages[Studio.StudioLocaleId]
13+
14+
local translator = Localization:GetTranslator(locale or defaultLocale)
15+
local fallback = locale ~= defaultLocale and Localization:GetTranslator(defaultLocale) -- JIC the string hasn't been translated
1416

17+
local function tr(key: string, args: any): string
1518
if Config.testLocalization then
1619
return key
1720
end
1821

1922
local ok, result = pcall(function()
20-
return l18n:FormatByKey(key, args)
23+
return translator:FormatByKey(key, args)
2124
end)
25+
26+
if not ok and fallback then
27+
ok, result = pcall(function()
28+
return fallback:FormatByKey(key, args)
29+
end)
30+
end
31+
2232
if ok then
2333
return result
2434
else

0 commit comments

Comments
 (0)