locales.schema.json 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "type": "object",
  4. "description": "All locales and translations that are available in BYTM.",
  5. "patternProperties": {
  6. "^[a-z]{2}-[A-Z]{2}$": {
  7. "type": "object",
  8. "required": ["name", "nameEnglish", "emoji", "userscriptDesc", "authors", "altLocales", "textDir", "sentenceTerminator"],
  9. "description": "Main locale code in the format \"ll-CC\" (language-COUNTRY).",
  10. "properties": {
  11. "name": {
  12. "type": "string",
  13. "description": "Native name and country of the language, e.g. \"Deutsch (Deutschland)\"."
  14. },
  15. "nameEnglish": {
  16. "type": "string",
  17. "description": "English name and country of the language, e.g. \"German (Germany)\".",
  18. "pattern": "^.+ \\(.+\\)$"
  19. },
  20. "emoji": {
  21. "type": "string",
  22. "pattern": "^[\uD83C\uDDE6-\uDDFF\uD83C\uDDE6-\uDDFF]{4}$",
  23. "description": "Flag emoji of the country."
  24. },
  25. "userscriptDesc": {
  26. "type": "string",
  27. "description": "Localized userscript description (from \"description\" in package.json)."
  28. },
  29. "authors": {
  30. "type": "array",
  31. "items": {
  32. "type": "string"
  33. },
  34. "description": "List of authors that contributed to the translation."
  35. },
  36. "altLocales": {
  37. "type": "array",
  38. "items": {
  39. "contains": {
  40. "pattern": "^[a-z]{2}$"
  41. },
  42. "type": "string",
  43. "pattern": "^[a-z]{2}(-[A-Z]{2})?$"
  44. },
  45. "description": "Alternative locale codes that will be redirected to this locale, e.g. for all German languages: [\"de\", \"de-AT\", \"de-CH\", \"de-LI\", \"de-LU\"]."
  46. },
  47. "textDir": {
  48. "type": "string",
  49. "enum": ["ltr", "rtl"],
  50. "description": "Text direction of the language."
  51. },
  52. "sentenceTerminator": {
  53. "type": "string",
  54. "description": "The character that ends a neutral, informative sentence, e.g. \".\", \"।\" or \"。\".",
  55. "pattern": "^.{1}$"
  56. }
  57. },
  58. "additionalProperties": false
  59. }
  60. },
  61. "additionalProperties": false
  62. }