Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization #649

Merged
merged 68 commits into from
Feb 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
a58d689
add auto-width tester
rpatters1 Jan 12, 2024
4f82981
auto resize width sample
rpatters1 Jan 13, 2024
e04897a
refinements
rpatters1 Jan 14, 2024
34a00ef
add ComboBox to mixin, plus sample
rpatters1 Jan 14, 2024
8d366dc
lint fix and sample update
rpatters1 Jan 15, 2024
7525a9f
add other auto-layout features
rpatters1 Jan 16, 2024
bf6cdb3
sample auto_layout updates
rpatters1 Jan 17, 2024
2ff3ea6
auto-layout sample for 0.71
rpatters1 Jan 17, 2024
aeb97b4
revise auto-layout demo script
rpatters1 Jan 18, 2024
a2fce80
fix issue with FCMCtrlCheckBox not storing state
rpatters1 Jan 18, 2024
c21a6f6
add 3-state checkbox for testing
rpatters1 Jan 18, 2024
fca08c9
fix text
rpatters1 Jan 18, 2024
78172fd
add localization demo
rpatters1 Jan 18, 2024
25af53c
refactor localization to add the localization tables to the library i…
rpatters1 Jan 19, 2024
c77f535
localize menu options of Transpose By Steps
rpatters1 Jan 19, 2024
5051a36
docs, tranposition localization
rpatters1 Jan 19, 2024
ae478e3
localization of transpose
rpatters1 Jan 19, 2024
77faaa6
fix a few typos
rpatters1 Jan 20, 2024
478fe45
make compatible with JW Lua
rpatters1 Jan 20, 2024
ea5b041
fix typo
rpatters1 Jan 20, 2024
9ee3264
Fix typos in Spanish text.
rpatters1 Jan 20, 2024
1788e8c
localized enharmonic transposition scripts
rpatters1 Jan 20, 2024
f2a8a92
refinements to localization
rpatters1 Jan 21, 2024
779811d
add localization for chromatic transpose
rpatters1 Jan 21, 2024
3e11d5c
refinements to localizing transposition
rpatters1 Jan 21, 2024
1e60872
auto_layout changes for latest RGP Lua dev branch
rpatters1 Jan 22, 2024
a0f6c21
Add mixin version of `__FCUserWindow::CreateChildUI` for backwards co…
rpatters1 Jan 23, 2024
f568680
update finenv with latest info
rpatters1 Jan 29, 2024
f0c0383
one more lint warning
rpatters1 Jan 31, 2024
5a78f36
transpose_by_step is working
rpatters1 Feb 1, 2024
2cf8a3d
transpose_chromatic
rpatters1 Feb 1, 2024
4249224
enharmonic transposing
rpatters1 Feb 1, 2024
324f9cc
Merge branch 'RGP-automatic-localization' into RGP-localization
rpatters1 Feb 1, 2024
e13bf80
lint errors
rpatters1 Feb 1, 2024
b1d8df1
refactor folder layout for localization
rpatters1 Feb 2, 2024
d7a89c3
Merge branch 'master' into RGP-localization
rpatters1 Feb 2, 2024
a936359
clarify comments
rpatters1 Feb 2, 2024
0f9c83e
checkpoint localization tool
rpatters1 Feb 3, 2024
64d59a8
checkpoint localization tool
rpatters1 Feb 3, 2024
f8ef97b
localization tool semi-working. main things missing are plugindef sup…
rpatters1 Feb 3, 2024
12f0a65
refactor sync openai calls to async
rpatters1 Feb 3, 2024
8c85429
line ending
rpatters1 Feb 3, 2024
88953d9
plugindef localization kind of working
rpatters1 Feb 4, 2024
4704eb2
plugindef localization is working
rpatters1 Feb 4, 2024
2efafc1
localize an example with a lot of additional menu items
rpatters1 Feb 4, 2024
9311b4a
Add script group name and description
rpatters1 Feb 4, 2024
983a675
minor updates
rpatters1 Feb 5, 2024
3a92c8c
Merge branch 'master' into RGP-localization
rpatters1 Feb 5, 2024
9a46284
Added table to list of types recognized by AddStrings method. Other m…
rpatters1 Feb 5, 2024
89423a0
refactor mixins per suggestions from ThistleSifter
rpatters1 Feb 6, 2024
48d4f32
Merge branch 'master' into RGP-localization
rpatters1 Feb 6, 2024
a2e17a0
a word
rpatters1 Feb 6, 2024
0a3f419
update sample localized script with latest approaches
rpatters1 Feb 6, 2024
7a3759e
Bundle localizations
asherber Feb 6, 2024
1abb39f
Merge pull request #6 from asherber/bundle-localization
rpatters1 Feb 6, 2024
8ff3c8c
address code review issues.
rpatters1 Feb 7, 2024
3bae150
in-progress checkpoint for Base localization.
rpatters1 Feb 7, 2024
5118dcc
Base localization added to all src scripts and utilities. Still need …
rpatters1 Feb 7, 2024
b38d2eb
auto_layout.lua code complete
rpatters1 Feb 7, 2024
d12bf4f
Merge branch 'master' into RGP-localization
rpatters1 Feb 8, 2024
c4c495d
update with latest agreed changes
rpatters1 Feb 8, 2024
5a3054d
fix lint error
rpatters1 Feb 8, 2024
48d7a85
Merge branch 'master' into RGP-localization
rpatters1 Feb 9, 2024
942fa21
add table support for multi-string arguments methods.
rpatters1 Feb 9, 2024
67be045
changed `process_string_arguments` to `create_multi_string_proxy` so …
rpatters1 Feb 9, 2024
c77beac
remove mobdebug
rpatters1 Feb 9, 2024
8a87b51
fix small issues discovered
rpatters1 Feb 9, 2024
44e53dc
Changes for `*AutoLocalized` mixin functions.
rpatters1 Feb 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update sample localized script with latest approaches
rpatters1 committed Feb 6, 2024
commit 0a3f419efa02c05099c9b218a3e2c0a214c9af3c
52 changes: 28 additions & 24 deletions samples/auto_layout.lua
Original file line number Diff line number Diff line change
@@ -9,7 +9,13 @@ local mixin = require('library.mixin')
local localization = require('library.localization')

--
-- This table was auto-generated with localization_developer.create_localized_base_table_string(en)
-- For scripts in the `src` directory, each localization should be separately stored in the
-- `localization` subdirectory. See the comments in `library/localization.lua` for more details.
-- The localization tables are included here in this sample to keep the sample self-contained.
--

--
-- This table was auto-generated with `utilities/localization_tool.lua`
-- Then it was edited to include only the strings that need to be localized.
--
localization.en = -- this is en_GB due to spelling of "Localisation"
@@ -38,9 +44,7 @@ localization.en_US =
}

--
-- The rest of the localization tables were created one-at-a-time with the auto_layout_localizing_script.lua
--
-- This table was auto-generated with localization_developer.translate_localized_table_string(localization.en, "en", "es")
-- The rest of the localization tables were created one-at-a-time with the `utilities/localization_tool.lua` script.
--
localization.es = {
["Action Button"] = "Botón de Acción",
@@ -62,7 +66,7 @@ localization.es = {
}

--
-- This table was auto-generated with localization_developer.translate_localized_table_string(localization.en, "en", "es")
-- This table was auto-generated with `utilities/localization_tool.lua`
--
localization.jp = {
["Action Button"] = "アクションボタン",
@@ -84,7 +88,7 @@ localization.jp = {
}

--
-- This table was auto-generated with localization_developer.translate_localized_table_string(localization.en, "en", "de")
-- This table was auto-generated with `utilities/localization_tool.lua`
--
localization.de = {
["Action Button"] = "Aktionsknopf",
@@ -185,7 +189,7 @@ localization.set_locale("fa")

function create_dialog()
local dlg = mixin.FCXCustomLuaWindow()
dlg:SetTitle(localization.localize("Test Autolayout With Localisation"))
dlg:SetTitleLocalized("Test Autolayout With Localisation")

local line_no = 0
local y_increment = 22
@@ -196,7 +200,7 @@ function create_dialog()
dlg:CreateStatic(0, line_no * y_increment, "option1-label")
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("First Option"))
:SetTextLocalized("First Option")
dlg:CreateEdit(0, line_no * y_increment - utils.win_mac(2, 3), "option1")
:SetInteger(1)
:AssureNoHorizontalOverlap(dlg:GetControl("option1-label"), label_edit_separ)
@@ -205,13 +209,13 @@ function create_dialog()
dlg:CreateCheckbox(0, line_no * y_increment, "left-checkbox1")
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("Left Checkbox Option 1"))
:SetTextLocalized("Left Checkbox Option 1")
line_no = line_no + 1

dlg:CreateStatic(0, line_no * y_increment, "option2-label")
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("Second Option"))
:SetTextLocalized("Second Option")
dlg:CreateEdit(10, line_no * y_increment - utils.win_mac(2, 3), "option2")
:SetInteger(2)
:AssureNoHorizontalOverlap(dlg:GetControl("option2-label"), label_edit_separ)
@@ -221,7 +225,7 @@ function create_dialog()
dlg:CreateCheckbox(0, line_no * y_increment, "left-checkbox2")
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("Left Checkbox Option 2"))
:SetTextLocalized("Left Checkbox Option 2")
line_no = line_no + 1

-- center vertical line
@@ -236,7 +240,7 @@ function create_dialog()
dlg:CreateStatic(0, line_no * y_increment, "option3-label")
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("Third Option"))
:SetTextLocalized("Third Option")
:AssureNoHorizontalOverlap(vertical_line, center_padding)
dlg:CreateEdit(0, line_no * y_increment - utils.win_mac(2, 3), "option3")
:SetInteger(3)
@@ -246,15 +250,15 @@ function create_dialog()
dlg:CreateCheckbox(0, line_no * y_increment, "right-checkbox1")
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("Right Three-State Option"))
:SetTextLocalized("Right Three-State Option")
:SetThreeStatesMode(true)
:AssureNoHorizontalOverlap(vertical_line, center_padding)
line_no = line_no + 1

dlg:CreateStatic(0, line_no * y_increment, "option4-label")
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("Fourth Option"))
:SetTextLocalized("Fourth Option")
:AssureNoHorizontalOverlap(vertical_line, center_padding)
dlg:CreateEdit(0, line_no * y_increment - utils.win_mac(2, 3), "option4")
:SetInteger(4)
@@ -265,7 +269,7 @@ function create_dialog()
dlg:CreateButton(0, line_no * y_increment)
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("Action Button"))
:SetTextLocalized("Action Button")
:AssureNoHorizontalOverlap(vertical_line, center_padding)
:HorizontallyAlignRightWith(dlg:GetControl("option4"))
-- :HorizontallyAlignRightWithFurthest()
@@ -281,16 +285,16 @@ function create_dialog()
dlg:CreateStatic(0, line_no * y_increment, "popup_label")
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("Menu"))
:SetTextLocalized("Menu")
local ctrl_popup = dlg:CreatePopup(0, line_no * y_increment - utils.win_mac(2, 2), "popup")
:DoAutoResizeWidth()
:SetWidth(0)
:AssureNoHorizontalOverlap(dlg:GetControl("popup_label"), label_edit_separ)
for counter = 1, 3 do
if counter == 3 then
ctrl_popup:AddString(finale.FCString(localization.localize("This is long menu text ") .. counter))
ctrl_popup:AddStringLocalized(localization.localize("This is long menu text ") .. counter)
else
ctrl_popup:AddString(finale.FCString(localization.localize("Short ") .. counter))
ctrl_popup:AddStringLocalized(localization.localize("Short ") .. counter)
end
end
ctrl_popup:SetSelectedItem(0)
@@ -299,17 +303,17 @@ function create_dialog()
dlg:CreateStatic(0, line_no * y_increment, "cbobox_label")
:DoAutoResizeWidth()
:SetWidth(0)
:SetText(localization.localize("Choices"))
:SetTextLocalized("Choices")
local ctrl_cbobox = dlg:CreateComboBox(0, line_no * y_increment - utils.win_mac(2, 3), "cbobox")
:DoAutoResizeWidth()
:SetWidth(40)
:AssureNoHorizontalOverlap(dlg:GetControl("cbobox_label"), label_edit_separ)
:HorizontallyAlignLeftWith(ctrl_popup)
for counter = 1, 3 do
if counter == 3 then
ctrl_cbobox:AddString(finale.FCString(localization.localize("This is long text choice ") .. counter))
ctrl_cbobox:AddString(localization.localize("This is long text choice ") .. counter)
else
ctrl_cbobox:AddString(finale.FCString(localization.localize("Short ") .. counter))
ctrl_cbobox:AddString(localization.localize("Short ") .. counter)
end
end
ctrl_cbobox:SetSelectedItem(0)
@@ -324,16 +328,16 @@ function create_dialog()
:AssureNoHorizontalOverlap(ctrl_popup, 10)
:AssureNoHorizontalOverlap(ctrl_cbobox, 10)
if counter == 2 then
rbtn:SetText(finale.FCString(localization.localize("This is longer option text ") .. counter))
rbtn:SetTextLocalized(localization.localize("This is longer option text ") .. counter)
else
rbtn:SetText(finale.FCString(localization.localize("Short ") .. counter))
rbtn:SetTextLocalized(localization.localize("Short ") .. counter)
end
counter = counter + 1
end
line_no = line_no + 2

dlg:CreateCloseButton(0, line_no * y_increment + 5)
:SetText(localization.localize("Close"))
:SetTextLocalized("Close")
:DoAutoResizeWidth()
:HorizontallyAlignRightWithFurthest()

32 changes: 0 additions & 32 deletions samples/auto_layout_localizing_script.lua

This file was deleted.

12 changes: 12 additions & 0 deletions src/mixin/__FCMUserWindow.lua
Original file line number Diff line number Diff line change
@@ -60,6 +60,18 @@ function methods:SetTitle(title)
self:SetTitle__(mixin_helper.to_fcstring(title, temp_str))
end

--[[
% SetTitleLocalized

Localized version of `SetTitle`.

**[Fluid] [Override]**

@ self (__FCMUserWindow)
@ title (FCString | string | number)
]]
methods.SetTitleLocalized = mixin_helper.create_localized_proxy("SetTitle")

--[[
% CreateChildUI