Skip to content

Internationalization - phase 2 #523

Open

Description

@Tkael

Jotting down some of the items that we've discussed for future internationalization improvements

Activity

  1. added
    needs thought
    on Jun 28, 2018
  2. richardbuckle commented on Nov 10, 2019

    @richardbuckle
    Member

    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.

  3. richardbuckle commented on Nov 11, 2019

    @richardbuckle
    Member

    Re Cottle I want:

    • diff-friendly on disk -- no more Cottle encoded in JSON <= this is key
    • Therefore each script resides in its own ".cottle" file, not JSON-encoded in an umbrella file because that sucks to edit and diff.
    • Therefore we add a new key "script_path" that is a relative path to a *.cottle file and overrides any existing "script" key.
    • This enables painless migration from the "script" key. to the "script_path" key.
  4. Tkael commented on Nov 11, 2019

    @Tkael
    MemberAuthor

    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?

  5. richardbuckle commented on Nov 11, 2019

    @richardbuckle
    Member

    All these are open for discussion.

  6. richardbuckle commented on Nov 11, 2019

    @richardbuckle
    Member

    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
    • from the base lang script of that name
  7. Tkael commented on Jun 18, 2020

    @Tkael
    MemberAuthor

    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

  8. removed
    needs thought
    on Feb 22, 2021
  9. richardbuckle commented on Mar 10, 2021

    @richardbuckle
    Member

    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.

    Thoughts welcomed.

  10. parduz commented on Apr 9, 2021

    @parduz

    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.

  11. richardbuckle commented on Apr 9, 2021

    @richardbuckle
    Member

    Good points, noted. I'm going to say a hard no to the "special comment" idea though. Down that path lies madness.

  12. richardbuckle commented on Apr 9, 2021

    @richardbuckle
    Member

    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.

  13. added theissue type on Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions