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
RESX files are complile-time, thus unsuitable for user-editing.
I have a better storage format in mind that may help here, one that mimics the RESX fallback model but allows for user override.
So if a ".cottle" isn't found, it would revert to the default? Would the default also be a ".cottle", would it be more like a ".resx", or would we keep the defaults in the current ".json" format?
I am envisaging a per-script fallback chain exactly as for RESX, by script name, but allowing for user modification at run time. So the lookup chain might be:
from tbe user-selected script of that name
from the default script of that name for the user's localisation
As discussed on Discord, we're considering a structure like this for a personality called foo:
foo/index.json -- the index file, resides in`%appdata%\EDDI\personalities
foo/de/ the German localisations
foo//.cottle : the scripts
I would have a single index file foo/index.json.
All scripts including en would be under foo/{language-code}/{script-name}.cottle.
foo/index.json uses simply script-name and the resolver tries foo/{language-code}/{script-name}.cottle for the current language code, falling back to en.
The main disadvantage about having a single file per script is that a lot of them shares some code (as example: pluralization) which is'nt trivial to change for localization. Having ALL the scripts in the same file will help in finding/replace the same code with the localized one.
Why not using some ... special comment (like {_ §021§ _} ) at the beginning of each script as an index (similar to the way certain auto-document programs reads "///" comments in C files)?
About comparing the localized scripts with the "invariant" one, problem is the compare engine have to be VERY smart:
right now adding a single line of comment makes it marking ALL the script as different; i can't think how it could check the same logic with different strings passed at the functions.
A very Useful thing for this would be making each script with a strict separation between a logic section (where it do all the needed checks and sets) and the "spoken" section, where localization will make almost everything different.
Many languages need to factor out their pluralisation rules, so I am thinking more along the lines of a global "Grammar" script to house such functions.
Activity
richardbuckle commentedon Nov 10, 2019
RESX files are complile-time, thus unsuitable for user-editing.
I have a better storage format in mind that may help here, one that mimics the RESX fallback model but allows for user override.
richardbuckle commentedon Nov 11, 2019
Re Cottle I want:
Tkael commentedon Nov 11, 2019
So if a ".cottle" isn't found, it would revert to the default? Would the default also be a ".cottle", would it be more like a ".resx", or would we keep the defaults in the current ".json" format?
richardbuckle commentedon Nov 11, 2019
All these are open for discussion.
richardbuckle commentedon Nov 11, 2019
I am envisaging a per-script fallback chain exactly as for RESX, by script name, but allowing for user modification at run time. So the lookup chain might be:
Tkael commentedon Jun 18, 2020
As discussed on Discord, we're considering a structure like this for a personality called foo:
foo/index.json -- the index file, resides in`%appdata%\EDDI\personalities
foo/de/ the German localisations
foo//.cottle : the scripts
richardbuckle commentedon Mar 10, 2021
I would have a single index file
foo/index.json.All scripts including
enwould be underfoo/{language-code}/{script-name}.cottle.foo/index.jsonuses simplyscript-nameand the resolver triesfoo/{language-code}/{script-name}.cottlefor the current language code, falling back toen.Thoughts welcomed.
parduz commentedon Apr 9, 2021
The main disadvantage about having a single file per script is that a lot of them shares some code (as example: pluralization) which is'nt trivial to change for localization. Having ALL the scripts in the same file will help in finding/replace the same code with the localized one.
Why not using some ... special comment (like {_ §021§ _} ) at the beginning of each script as an index (similar to the way certain auto-document programs reads "///" comments in C files)?
About comparing the localized scripts with the "invariant" one, problem is the compare engine have to be VERY smart:
right now adding a single line of comment makes it marking ALL the script as different; i can't think how it could check the same logic with different strings passed at the functions.
A very Useful thing for this would be making each script with a strict separation between a logic section (where it do all the needed checks and sets) and the "spoken" section, where localization will make almost everything different.
richardbuckle commentedon Apr 9, 2021
Good points, noted. I'm going to say a hard no to the "special comment" idea though. Down that path lies madness.
richardbuckle commentedon Apr 9, 2021
Many languages need to factor out their pluralisation rules, so I am thinking more along the lines of a global "Grammar" script to house such functions.