A localization library to use with dalamud plugin projects for FFXIV. Avoid boring boilerplate code in your plugin project and use this instead. The library supports JSON and can load strings directly, embedded resources, and local/remote files. Brought to you by SheepGoMeh and kalilistic.
{
"OptionShowFriends": "Afficher les amis",
"OptionLanguage": "Langue",
"LanguageName": "Français"
}
// create localization obj
var loc = new Localization(dalamudPluginInterface);
// load language
loc.LoadLanguage(Language.French, frenchStringsJson);
// set current language
loc.CurrentLanguage = Language.French;
// use localized strings
var text = loc.GetString("MyStringKey");
// clean up when done
loc.Dispose();
// load from string
loc.LoadLanguage(Language.French, frenchStringsJson);
// load from local file
loc.LoadLanguageFromFile(Language.French, pluginInterface.ConfigDirectory + "/loc/fr.json");
// load from embedded resource
loc.LoadLanguageFromAssembly(Language.French, "MyPlugin.Resource.translation.fr.json");
// load from remote file
loc.LoadLanguageFromUrl(Language.French, urlToJson);
LocGui.Text("MyStringKey");