Add joke belarusian locale + add locale notes

This commit is contained in:
Basique Evangelist 2019-02-06 20:38:51 +03:00
parent fb1843360c
commit 7552303a6e
5 changed files with 13 additions and 4 deletions

View File

@ -57,7 +57,8 @@ namespace JetKarmaBot.Commands
Client.SendTextMessageAsync( Client.SendTextMessageAsync(
args.Message.Chat.Id, args.Message.Chat.Id,
currentLocale["jetkarmabot.changelocale.justchanged"], (currentLocale.HasNote ? currentLocale["jetkarmabot.changelocale.beforenote"] + currentLocale.Note + "\n" : "")
+ currentLocale["jetkarmabot.changelocale.justchanged"],
replyToMessageId: args.Message.MessageId); replyToMessageId: args.Message.MessageId);
return true; return true;
} }

View File

@ -105,15 +105,20 @@ namespace JetKarmaBot
private Dictionary<string, string> locale; private Dictionary<string, string> locale;
private string localeName; private string localeName;
private string[] commonNames; private string[] commonNames;
private string note;
public Locale(JObject locale, string localeName) public Locale(JObject locale, string localeName)
{ {
this.locale = locale.Property("strings").Value.ToObject<Dictionary<string, string>>(); this.locale = locale.Property("strings").Value.ToObject<Dictionary<string, string>>();
this.localeName = localeName; this.localeName = localeName;
this.commonNames = locale.Property("names").Value.ToObject<string[]>(); this.commonNames = locale.Property("names").Value.ToObject<string[]>();
if (locale.ContainsKey("note")) this.note = locale.Property("note").Value.ToObject<string>();
} }
public string[] CommonNames => commonNames; public string[] CommonNames => commonNames;
public string Name => localeName; public string Name => localeName;
public bool HasNote => note != null;
public string Note => note;
public string this[string name] => locale.ContainsKey(name) ? locale[name] : "unknown"; public string this[string name] => locale.ContainsKey(name) ? locale[name] : "unknown";
} }
} }

View File

@ -19,6 +19,7 @@
"jetkarmabot.changelocale.justchanged": "Так дакладна.", "jetkarmabot.changelocale.justchanged": "Так дакладна.",
"jetkarmabot.changelocale.getlocale": "Я зараз кажу па-беларускай.", "jetkarmabot.changelocale.getlocale": "Я зараз кажу па-беларускай.",
"jetkarmabot.changelocale.listalltext": "Я ведаю:", "jetkarmabot.changelocale.listalltext": "Я ведаю:",
"jetkarmabot.changelocale.errorall": "Мне б хацелася гаварыць на ўсіх мовах у той жа самы час, але з-за абмежаванняў сусвету, мне гэта не дазваляецца." "jetkarmabot.changelocale.errorall": "Мне б хацелася гаварыць на ўсіх мовах у той жа самы час, але з-за абмежаванняў сусвету, мне гэта не дазваляецца.",
"jetkarmabot.changelocale.beforenote": "Увага: "
} }
} }

View File

@ -18,6 +18,7 @@
"jetkarmabot.changelocale.justchanged": "Roger that.", "jetkarmabot.changelocale.justchanged": "Roger that.",
"jetkarmabot.changelocale.getlocale": "I'm currently speaking English.", "jetkarmabot.changelocale.getlocale": "I'm currently speaking English.",
"jetkarmabot.changelocale.listalltext": "I know:", "jetkarmabot.changelocale.listalltext": "I know:",
"jetkarmabot.changelocale.errorall": "I would like to speak all languages at once, but because of the rules of the universe, I am not allowed to do that." "jetkarmabot.changelocale.errorall": "I would like to speak all languages at once, but because of the rules of the universe, I am not allowed to do that.",
"jetkarmabot.changelocale.beforenote": "Warning: "
} }
} }

View File

@ -18,6 +18,7 @@
"jetkarmabot.changelocale.justchanged": "Так точно.", "jetkarmabot.changelocale.justchanged": "Так точно.",
"jetkarmabot.changelocale.getlocale": "Я сейчас говорю по-русски.", "jetkarmabot.changelocale.getlocale": "Я сейчас говорю по-русски.",
"jetkarmabot.changelocale.listalltext": "Я знаю:", "jetkarmabot.changelocale.listalltext": "Я знаю:",
"jetkarmabot.changelocale.errorall": "Мне бы хотелось говорить на всех языках в то же самое время, но из-за ограничений вселенной, мне это не позволяется." "jetkarmabot.changelocale.errorall": "Мне бы хотелось говорить на всех языках в то же самое время, но из-за ограничений вселенной, мне это не позволяется.",
"jetkarmabot.changelocale.beforenote": "Внимание: "
} }
} }