You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add auto-width tester
* auto resize width sample
* refinements
* add ComboBox to mixin, plus sample
* lint fix and sample update
* add other auto-layout features
* sample auto_layout updates
* auto-layout sample for 0.71
* revise auto-layout demo script
* fix issue with FCMCtrlCheckBox not storing state
* add 3-state checkbox for testing
* fix text
* add localization demo
* refactor localization to add the localization tables to the library itself.
* localize menu options of Transpose By Steps
* docs, tranposition localization
* localization of transpose
* fix a few typos
* make compatible with JW Lua
* fix typo
* Fix typos in Spanish text.
* localized enharmonic transposition scripts
* refinements to localization
* add localization for chromatic transpose
* refinements to localizing transposition
* auto_layout changes for latest RGP Lua dev branch
* Add mixin version of `__FCUserWindow::CreateChildUI` for backwards compatibility with JW Lua.
* update finenv with latest info
* one more lint warning
* transpose_by_step is working
* transpose_chromatic
* enharmonic transposing
* lint errors
* refactor folder layout for localization
* clarify comments
* checkpoint localization tool
* checkpoint localization tool
* localization tool semi-working. main things missing are plugindef support and async openai calls
* refactor sync openai calls to async
* line ending
* plugindef localization kind of working
* plugindef localization is working
* localize an example with a lot of additional menu items
* Add script group name and description
* minor updates
* Added table to list of types recognized by AddStrings method. Other mods to take advantage of this.
* refactor mixins per suggestions from ThistleSifter
* a word
* update sample localized script with latest approaches
* Bundle localizations
* address code review issues.
* in-progress checkpoint for Base localization.
* Base localization added to all src scripts and utilities. Still need to work on format strings.
* auto_layout.lua code complete
* update with latest agreed changes
* fix lint error
* add table support for multi-string arguments methods.
* changed `process_string_arguments` to `create_multi_string_proxy` so that errors are reported at the correct level, rather than in `tryfunczzz`.
* remove mobdebug
* fix small issues discovered
* Changes for `*AutoLocalized` mixin functions.
---------
Co-authored-by: Aaron Sherber <[email protected]>
@@ -285,7 +285,6 @@ The `plugindef()` function is an optional function that **only** should do a _ma
285
285
* Return the _plug-in name_, _undo string_ and _brief description_ to be used in the _Finale_ plug-in menu and for automatic undo blocks.
286
286
* Define the `finaleplugin` namespace environment to further describe the plug-in (see below).
287
287
288
-
289
288
A simple `plugindef()` implementation might look like this:
290
289
291
290
```lua
@@ -296,7 +295,36 @@ function plugindef()
296
295
end
297
296
```
298
297
299
-
`plugindef()` is considered to be a reserved name in the global namespace. If the script has a function named `plugindef()`, the Lua plugin may call it at any time (not only during script execution) to gather information about the plug-in. The `plugindef()` function can **NOT** have dependencies outside the function itself.
298
+
Starting with version 0.71, _RGP Lua_ passes the user's locale code as an argument to the `plugindef` function. You can use this to localize any strings returned by the function or assigned to variables. The user's locale code is a 2-character lowercase language code followed by "_" or "-" and then a 2-digit uppercase region code. This is the same value that is returned by `finenv.UI():GetUserLocaleName()`. (See the note below detailing why the `plugindef` function cannot call `GetUserLocaleName` directly.)
299
+
300
+
A localized version of the same function might look like this:
301
+
302
+
```lua
303
+
functionplugindef(locale)
304
+
finaleplugin.RequireSelection=true
305
+
finaleplugin.CategoryTags="Rest, Region"
306
+
locallocalization= {}
307
+
localization.en= {
308
+
menu="Hide Rests",
309
+
desc="Hides all rests in the selected region."
310
+
}
311
+
localization.es= {
312
+
menu="Ocultar Silencios",
313
+
desc="Oculta todos los silencios en la región seleccionada."
Note that the `plugindef()` function must be *entirely* self-contained. It may not have access to any of the global namespaces that the rest of the script uses, such as `finenv` or `finale`. It *does* have access to all the standard Lua libraries. If the script has a function named `plugindef()`, the Lua plugin may call it at any time (not only during script execution) to gather information about the plug-in.
326
+
327
+
`plugindef` is a reserved name in the global namespace.
300
328
301
329
All aspects of the `plugindef()` are optional, but for a plug-in script that is going to be used repeatedly, the minimum should be to return a plug-in name, undo string, and short description.
Copy file name to clipboardexpand all lines: docs/rgp-lua/finenv-properties.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -245,22 +245,23 @@ end
245
245
246
246
A list of constants that define the type of message returned by `finenv.ExecuteLuaScriptItem` (if any).
247
247
248
-
-`SCRIPT_RESULT` : The message was returned by Lua. It could be either an error or a value returned by the script. If it is an error, the first value returned by `ExecuteLuaScriptItem` is false.|
248
+
-`SCRIPT_RESULT` : The message was returned by the Lua script. This is not an error message.
249
249
-`DOCUMENT_REQUIRED` : The script was not executed because it specified `finaleplugin.RequireDocument = true` but no document was open.
250
250
-`SELECTION_REQUIRED` : The script was not executed because it specified `finaleplugin.RequireSelection = true` but there was no selection.
251
251
-`SCORE_REQUIRED` : The script was not executed because it specified `finaleplugin.RequireScore = true` but the document was viewing a part.
252
252
-`FINALE_VERSION_MISMATCH` : The script was not executed because it specified a minimum or maximum Finale version and the current running version of Finale does not meet the requirement.
253
253
-`LUA_PLUGIN_VERSION_MISMATCH` : The script was not executed because it specified a minimum or maximum Lua plugin version and the current running version of _RGP Lua_ does not meet the requirement.
254
254
-`MISCELLANEOUS` : Other types of error messages that do not fit any of the other categories.
255
255
-`EXTERNAL_TERMINATION` : The script was externally terminated by the user or a controlling script.
256
+
-`LUA_ERROR` : The message is an error message returned by Lua.
0 commit comments