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

Dynamically generated localization keys #1609

Open
koosemose opened this issue Nov 3, 2016 · 3 comments
Open

Dynamically generated localization keys #1609

koosemose opened this issue Nov 3, 2016 · 3 comments

Comments

@koosemose
Copy link
Collaborator

Currently localization keys are explicitly set in the xml, however in nearly all cases the localization key for the name is some form of the item's type, and the localization key for description is that plus _desc.

With the changes to item types in #1607 (rename all items to use the same scheme) this makes the localization keys item_class+item_type, and for description +_desc. We could easily have GetName() return the class shorthand + the item type, and have GetDescription return that plus _desc.

Pros:
No need to explicitly set Localization Codes in xml
Localization codes will follow a consistent scheme (so long as the item type is kept consistent)

Cons:
It may not be obvious to new developers/modders what the appropriate localization code for an item would be.

@UnknownDude1
Copy link
Contributor

UnknownDude1 commented Nov 3, 2016

I think I would be against generated keys, because this one con might actually make this entire system a pain. I want to have this extra key in the xml and have it really obvious rather than having it generated and maybe having to debug something that really shouldn't have to be debugged.

@dusho
Copy link
Contributor

dusho commented Nov 3, 2016

I would be also against having some 'magic' link between things that is not obvious from looking at .xml files. Having things explicitly in .xml may be too verbose, but modders don't have to deal with all the magic rules that may be applied to various things

@Geoffrotism
Copy link
Contributor

I'm all for this. Just add a _readme to the top of the localization folder that explains the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants