WoW:Localizing an addon: Difference between revisions

m
(→‎localization.core.lua: break comment into multiple lines)
Line 137: Line 137:
== Tips and common pitfalls ==
== Tips and common pitfalls ==
* It is a generally good idea to separate localizable strings from your addon code if you intend to make your addon localizable -- concentrating localization in a few files makes it more approachable.
* It is a generally good idea to separate localizable strings from your addon code if you intend to make your addon localizable -- concentrating localization in a few files makes it more approachable.
* Avoid using names to identify things you can identify by ID instead (this would include items, spells, quests, NPCs, etc). IDs do not need to be localized, saving you work, and allowing your addon to work on a client of a different locale, even if only by using the original alnguage.
* Avoid using names to identify things you can identify by ID instead (this would include items, spells, quests, NPCs, etc). IDs do not need to be localized, saving you work, and allowing your addon to work on a client of a different locale, even if only by using the original language.
* Not everything must have a translation, and some things will break if translated. For instance, the names of the World of Warcraft API functions, XML elements, etc, do not need to be translated, since those names are hard-coded in either the client or FrameXML, and do not change with localizations.
* Not everything must have a translation, and some things will break if translated. For instance, the names of the World of Warcraft API functions, XML elements, etc, do not need to be translated, since those names are hard-coded in either the client or FrameXML, and do not change with localizations.


Anonymous user