Make translations for SAS emoji available in-tree (#2728)

* add a base file

* Fix directory name

* Added translation using Weblate (English)

* Translated using Weblate (English)

Currently translated at 1.6% (1 of 64 strings)

Translation: matrix-doc/SAS Emoji v1
Translate-URL: https://translate.riot.im/projects/matrix-doc/sas-emoji-v1/en_EN/

* add english files

* delete english files

* Added translation using Weblate (English)

* Added translation using Weblate (English)

* Do manual translations

* Deleted translation using Weblate (English)

* Deleted translation using Weblate (English)

* Add a script to update the definitions with the translations

* update i18n

* Add a note to the spec about translations

* changelog

* Ensure translations end with json
pull/977/head
Travis Ralston 4 years ago committed by GitHub
parent 8eb1c53144
commit d37f7a25b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1 @@
Added a common set of translations for SAS Emoji.

@ -0,0 +1,66 @@
{
"Dog": "Dog",
"Cat": "Cat",
"Lion": "Lion",
"Horse": "Horse",
"Unicorn": "Unicorn",
"Pig": "Pig",
"Elephant": "Elephant",
"Rabbit": "Rabbit",
"Panda": "Panda",
"Rooster": "Rooster",
"Penguin": "Penguin",
"Turtle": "Turtle",
"Fish": "Fish",
"Octopus": "Octopus",
"Butterfly": "Butterfly",
"Flower": "Flower",
"Tree": "Tree",
"Cactus": "Cactus",
"Mushroom": "Mushroom",
"Globe": "Globe",
"Moon": "Moon",
"Cloud": "Cloud",
"Fire": "Fire",
"Banana": "Banana",
"Apple": "Apple",
"Strawberry": "Strawberry",
"Corn": "Corn",
"Pizza": "Pizza",
"Cake": "Cake",
"Heart": "Heart",
"Smiley": "Smiley",
"Robot": "Robot",
"Hat": "Hat",
"Glasses": "Glasses",
"Spanner": "Spanner",
"Santa": "Santa",
"Thumbs Up": "Thumbs Up",
"Umbrella": "Umbrella",
"Hourglass": "Hourglass",
"Clock": "Clock",
"Gift": "Gift",
"Light Bulb": "Light Bulb",
"Book": "Book",
"Pencil": "Pencil",
"Paperclip": "Paperclip",
"Scissors": "Scissors",
"Lock": "Lock",
"Key": "Key",
"Hammer": "Hammer",
"Telephone": "Telephone",
"Flag": "Flag",
"Train": "Train",
"Bicycle": "Bicycle",
"Aeroplane": "Aeroplane",
"Rocket": "Rocket",
"Trophy": "Trophy",
"Ball": "Ball",
"Guitar": "Guitar",
"Trumpet": "Trumpet",
"Bell": "Bell",
"Anchor": "Anchor",
"Headphones": "Headphones",
"Folder": "Folder",
"Pin": "Pin"
}

@ -1,66 +1,450 @@
[
{"number": 0, "emoji": "🐶", "description": "Dog", "unicode": "U+1F436"},
{"number": 1, "emoji": "🐱", "description": "Cat", "unicode": "U+1F431"},
{"number": 2, "emoji": "🦁", "description": "Lion", "unicode": "U+1F981"},
{"number": 3, "emoji": "🐎", "description": "Horse", "unicode": "U+1F40E"},
{"number": 4, "emoji": "🦄", "description": "Unicorn", "unicode": "U+1F984"},
{"number": 5, "emoji": "🐷", "description": "Pig", "unicode": "U+1F437"},
{"number": 6, "emoji": "🐘", "description": "Elephant", "unicode": "U+1F418"},
{"number": 7, "emoji": "🐰", "description": "Rabbit", "unicode": "U+1F430"},
{"number": 8, "emoji": "🐼", "description": "Panda", "unicode": "U+1F43C"},
{"number": 9, "emoji": "🐓", "description": "Rooster", "unicode": "U+1F413"},
{"number": 10, "emoji": "🐧", "description": "Penguin", "unicode": "U+1F427"},
{"number": 11, "emoji": "🐢", "description": "Turtle", "unicode": "U+1F422"},
{"number": 12, "emoji": "🐟", "description": "Fish", "unicode": "U+1F41F"},
{"number": 13, "emoji": "🐙", "description": "Octopus", "unicode": "U+1F419"},
{"number": 14, "emoji": "🦋", "description": "Butterfly", "unicode": "U+1F98B"},
{"number": 15, "emoji": "🌷", "description": "Flower", "unicode": "U+1F337"},
{"number": 16, "emoji": "🌳", "description": "Tree", "unicode": "U+1F333"},
{"number": 17, "emoji": "🌵", "description": "Cactus", "unicode": "U+1F335"},
{"number": 18, "emoji": "🍄", "description": "Mushroom", "unicode": "U+1F344"},
{"number": 19, "emoji": "🌏", "description": "Globe", "unicode": "U+1F30F"},
{"number": 20, "emoji": "🌙", "description": "Moon", "unicode": "U+1F319"},
{"number": 21, "emoji": "☁️", "description": "Cloud", "unicode": "U+2601U+FE0F"},
{"number": 22, "emoji": "🔥", "description": "Fire", "unicode": "U+1F525"},
{"number": 23, "emoji": "🍌", "description": "Banana", "unicode": "U+1F34C"},
{"number": 24, "emoji": "🍎", "description": "Apple", "unicode": "U+1F34E"},
{"number": 25, "emoji": "🍓", "description": "Strawberry", "unicode": "U+1F353"},
{"number": 26, "emoji": "🌽", "description": "Corn", "unicode": "U+1F33D"},
{"number": 27, "emoji": "🍕", "description": "Pizza", "unicode": "U+1F355"},
{"number": 28, "emoji": "🎂", "description": "Cake", "unicode": "U+1F382"},
{"number": 29, "emoji": "❤️", "description": "Heart", "unicode": "U+2764U+FE0F"},
{"number": 30, "emoji": "😀", "description": "Smiley", "unicode": "U+1F600"},
{"number": 31, "emoji": "🤖", "description": "Robot", "unicode": "U+1F916"},
{"number": 32, "emoji": "🎩", "description": "Hat", "unicode": "U+1F3A9"},
{"number": 33, "emoji": "👓", "description": "Glasses", "unicode": "U+1F453"},
{"number": 34, "emoji": "🔧", "description": "Spanner", "unicode": "U+1F527"},
{"number": 35, "emoji": "🎅", "description": "Santa", "unicode": "U+1F385"},
{"number": 36, "emoji": "👍", "description": "Thumbs Up", "unicode": "U+1F44D"},
{"number": 37, "emoji": "☂️", "description": "Umbrella", "unicode": "U+2602U+FE0F"},
{"number": 38, "emoji": "⌛", "description": "Hourglass", "unicode": "U+231B"},
{"number": 39, "emoji": "⏰", "description": "Clock", "unicode": "U+23F0"},
{"number": 40, "emoji": "🎁", "description": "Gift", "unicode": "U+1F381"},
{"number": 41, "emoji": "💡", "description": "Light Bulb", "unicode": "U+1F4A1"},
{"number": 42, "emoji": "📕", "description": "Book", "unicode": "U+1F4D5"},
{"number": 43, "emoji": "✏️", "description": "Pencil", "unicode": "U+270FU+FE0F"},
{"number": 44, "emoji": "📎", "description": "Paperclip", "unicode": "U+1F4CE"},
{"number": 45, "emoji": "✂️", "description": "Scissors", "unicode": "U+2702U+FE0F"},
{"number": 46, "emoji": "🔒", "description": "Lock", "unicode": "U+1F512"},
{"number": 47, "emoji": "🔑", "description": "Key", "unicode": "U+1F511"},
{"number": 48, "emoji": "🔨", "description": "Hammer", "unicode": "U+1F528"},
{"number": 49, "emoji": "☎️", "description": "Telephone", "unicode": "U+260EU+FE0F"},
{"number": 50, "emoji": "🏁", "description": "Flag", "unicode": "U+1F3C1"},
{"number": 51, "emoji": "🚂", "description": "Train", "unicode": "U+1F682"},
{"number": 52, "emoji": "🚲", "description": "Bicycle", "unicode": "U+1F6B2"},
{"number": 53, "emoji": "✈️", "description": "Aeroplane", "unicode": "U+2708U+FE0F"},
{"number": 54, "emoji": "🚀", "description": "Rocket", "unicode": "U+1F680"},
{"number": 55, "emoji": "🏆", "description": "Trophy", "unicode": "U+1F3C6"},
{"number": 56, "emoji": "⚽", "description": "Ball", "unicode": "U+26BD"},
{"number": 57, "emoji": "🎸", "description": "Guitar", "unicode": "U+1F3B8"},
{"number": 58, "emoji": "🎺", "description": "Trumpet", "unicode": "U+1F3BA"},
{"number": 59, "emoji": "🔔", "description": "Bell", "unicode": "U+1F514"},
{"number": 60, "emoji": "⚓", "description": "Anchor", "unicode": "U+2693"},
{"number": 61, "emoji": "🎧", "description": "Headphones", "unicode": "U+1F3A7"},
{"number": 62, "emoji": "📁", "description": "Folder", "unicode": "U+1F4C1"},
{"number": 63, "emoji": "📌", "description": "Pin", "unicode": "U+1F4CC"}
]
{
"number": 0,
"emoji": "🐶",
"description": "Dog",
"unicode": "U+1F436",
"translated_descriptions": {}
},
{
"number": 1,
"emoji": "🐱",
"description": "Cat",
"unicode": "U+1F431",
"translated_descriptions": {}
},
{
"number": 2,
"emoji": "🦁",
"description": "Lion",
"unicode": "U+1F981",
"translated_descriptions": {}
},
{
"number": 3,
"emoji": "🐎",
"description": "Horse",
"unicode": "U+1F40E",
"translated_descriptions": {}
},
{
"number": 4,
"emoji": "🦄",
"description": "Unicorn",
"unicode": "U+1F984",
"translated_descriptions": {}
},
{
"number": 5,
"emoji": "🐷",
"description": "Pig",
"unicode": "U+1F437",
"translated_descriptions": {}
},
{
"number": 6,
"emoji": "🐘",
"description": "Elephant",
"unicode": "U+1F418",
"translated_descriptions": {}
},
{
"number": 7,
"emoji": "🐰",
"description": "Rabbit",
"unicode": "U+1F430",
"translated_descriptions": {}
},
{
"number": 8,
"emoji": "🐼",
"description": "Panda",
"unicode": "U+1F43C",
"translated_descriptions": {}
},
{
"number": 9,
"emoji": "🐓",
"description": "Rooster",
"unicode": "U+1F413",
"translated_descriptions": {}
},
{
"number": 10,
"emoji": "🐧",
"description": "Penguin",
"unicode": "U+1F427",
"translated_descriptions": {}
},
{
"number": 11,
"emoji": "🐢",
"description": "Turtle",
"unicode": "U+1F422",
"translated_descriptions": {}
},
{
"number": 12,
"emoji": "🐟",
"description": "Fish",
"unicode": "U+1F41F",
"translated_descriptions": {}
},
{
"number": 13,
"emoji": "🐙",
"description": "Octopus",
"unicode": "U+1F419",
"translated_descriptions": {}
},
{
"number": 14,
"emoji": "🦋",
"description": "Butterfly",
"unicode": "U+1F98B",
"translated_descriptions": {}
},
{
"number": 15,
"emoji": "🌷",
"description": "Flower",
"unicode": "U+1F337",
"translated_descriptions": {}
},
{
"number": 16,
"emoji": "🌳",
"description": "Tree",
"unicode": "U+1F333",
"translated_descriptions": {}
},
{
"number": 17,
"emoji": "🌵",
"description": "Cactus",
"unicode": "U+1F335",
"translated_descriptions": {}
},
{
"number": 18,
"emoji": "🍄",
"description": "Mushroom",
"unicode": "U+1F344",
"translated_descriptions": {}
},
{
"number": 19,
"emoji": "🌏",
"description": "Globe",
"unicode": "U+1F30F",
"translated_descriptions": {}
},
{
"number": 20,
"emoji": "🌙",
"description": "Moon",
"unicode": "U+1F319",
"translated_descriptions": {}
},
{
"number": 21,
"emoji": "☁️",
"description": "Cloud",
"unicode": "U+2601U+FE0F",
"translated_descriptions": {}
},
{
"number": 22,
"emoji": "🔥",
"description": "Fire",
"unicode": "U+1F525",
"translated_descriptions": {}
},
{
"number": 23,
"emoji": "🍌",
"description": "Banana",
"unicode": "U+1F34C",
"translated_descriptions": {}
},
{
"number": 24,
"emoji": "🍎",
"description": "Apple",
"unicode": "U+1F34E",
"translated_descriptions": {}
},
{
"number": 25,
"emoji": "🍓",
"description": "Strawberry",
"unicode": "U+1F353",
"translated_descriptions": {}
},
{
"number": 26,
"emoji": "🌽",
"description": "Corn",
"unicode": "U+1F33D",
"translated_descriptions": {}
},
{
"number": 27,
"emoji": "🍕",
"description": "Pizza",
"unicode": "U+1F355",
"translated_descriptions": {}
},
{
"number": 28,
"emoji": "🎂",
"description": "Cake",
"unicode": "U+1F382",
"translated_descriptions": {}
},
{
"number": 29,
"emoji": "❤️",
"description": "Heart",
"unicode": "U+2764U+FE0F",
"translated_descriptions": {}
},
{
"number": 30,
"emoji": "😀",
"description": "Smiley",
"unicode": "U+1F600",
"translated_descriptions": {}
},
{
"number": 31,
"emoji": "🤖",
"description": "Robot",
"unicode": "U+1F916",
"translated_descriptions": {}
},
{
"number": 32,
"emoji": "🎩",
"description": "Hat",
"unicode": "U+1F3A9",
"translated_descriptions": {}
},
{
"number": 33,
"emoji": "👓",
"description": "Glasses",
"unicode": "U+1F453",
"translated_descriptions": {}
},
{
"number": 34,
"emoji": "🔧",
"description": "Spanner",
"unicode": "U+1F527",
"translated_descriptions": {}
},
{
"number": 35,
"emoji": "🎅",
"description": "Santa",
"unicode": "U+1F385",
"translated_descriptions": {}
},
{
"number": 36,
"emoji": "👍",
"description": "Thumbs Up",
"unicode": "U+1F44D",
"translated_descriptions": {}
},
{
"number": 37,
"emoji": "☂️",
"description": "Umbrella",
"unicode": "U+2602U+FE0F",
"translated_descriptions": {}
},
{
"number": 38,
"emoji": "⌛",
"description": "Hourglass",
"unicode": "U+231B",
"translated_descriptions": {}
},
{
"number": 39,
"emoji": "⏰",
"description": "Clock",
"unicode": "U+23F0",
"translated_descriptions": {}
},
{
"number": 40,
"emoji": "🎁",
"description": "Gift",
"unicode": "U+1F381",
"translated_descriptions": {}
},
{
"number": 41,
"emoji": "💡",
"description": "Light Bulb",
"unicode": "U+1F4A1",
"translated_descriptions": {}
},
{
"number": 42,
"emoji": "📕",
"description": "Book",
"unicode": "U+1F4D5",
"translated_descriptions": {}
},
{
"number": 43,
"emoji": "✏️",
"description": "Pencil",
"unicode": "U+270FU+FE0F",
"translated_descriptions": {}
},
{
"number": 44,
"emoji": "📎",
"description": "Paperclip",
"unicode": "U+1F4CE",
"translated_descriptions": {}
},
{
"number": 45,
"emoji": "✂️",
"description": "Scissors",
"unicode": "U+2702U+FE0F",
"translated_descriptions": {}
},
{
"number": 46,
"emoji": "🔒",
"description": "Lock",
"unicode": "U+1F512",
"translated_descriptions": {}
},
{
"number": 47,
"emoji": "🔑",
"description": "Key",
"unicode": "U+1F511",
"translated_descriptions": {}
},
{
"number": 48,
"emoji": "🔨",
"description": "Hammer",
"unicode": "U+1F528",
"translated_descriptions": {}
},
{
"number": 49,
"emoji": "☎️",
"description": "Telephone",
"unicode": "U+260EU+FE0F",
"translated_descriptions": {}
},
{
"number": 50,
"emoji": "🏁",
"description": "Flag",
"unicode": "U+1F3C1",
"translated_descriptions": {}
},
{
"number": 51,
"emoji": "🚂",
"description": "Train",
"unicode": "U+1F682",
"translated_descriptions": {}
},
{
"number": 52,
"emoji": "🚲",
"description": "Bicycle",
"unicode": "U+1F6B2",
"translated_descriptions": {}
},
{
"number": 53,
"emoji": "✈️",
"description": "Aeroplane",
"unicode": "U+2708U+FE0F",
"translated_descriptions": {}
},
{
"number": 54,
"emoji": "🚀",
"description": "Rocket",
"unicode": "U+1F680",
"translated_descriptions": {}
},
{
"number": 55,
"emoji": "🏆",
"description": "Trophy",
"unicode": "U+1F3C6",
"translated_descriptions": {}
},
{
"number": 56,
"emoji": "⚽",
"description": "Ball",
"unicode": "U+26BD",
"translated_descriptions": {}
},
{
"number": 57,
"emoji": "🎸",
"description": "Guitar",
"unicode": "U+1F3B8",
"translated_descriptions": {}
},
{
"number": 58,
"emoji": "🎺",
"description": "Trumpet",
"unicode": "U+1F3BA",
"translated_descriptions": {}
},
{
"number": 59,
"emoji": "🔔",
"description": "Bell",
"unicode": "U+1F514",
"translated_descriptions": {}
},
{
"number": 60,
"emoji": "⚓",
"description": "Anchor",
"unicode": "U+2693",
"translated_descriptions": {}
},
{
"number": 61,
"emoji": "🎧",
"description": "Headphones",
"unicode": "U+1F3A7",
"translated_descriptions": {}
},
{
"number": 62,
"emoji": "📁",
"description": "Folder",
"unicode": "U+1F4C1",
"translated_descriptions": {}
},
{
"number": 63,
"emoji": "📌",
"description": "Pin",
"unicode": "U+1F4CC",
"translated_descriptions": {}
}
]

@ -19,6 +19,8 @@ The remainder of the process is as follows:
1. Having checked out the new release branch, navigate your way over to `./changelogs`.
1. Follow the release instructions provided in the README.md located there.
1. Update any version/link references across all specifications.
1. From translate.riot.im, push repository changes and merge the subsequent PR.
1. Run `./scripts/i18n.py` to ensure all translatable files are up to date.
1. Generate the specification using `./scripts/gendoc.py`, specifying all the
API versions at the time of generation. For example: `./scripts/gendoc.py -c r0.4.0 -s r0.1.0 -i r0.1.0 #etc`
1. PR the changes to the matrix-org/matrix.org repository (for historic tracking).

@ -0,0 +1,32 @@
#!/usr/bin/env python3
#
# i18n.py: Generate and merge the i18n files for the spec.
import json
import sys
import os
import os.path
scripts_dir = os.path.dirname(os.path.abspath(__file__))
data_defs_dir = os.path.join(scripts_dir, "../data-definitions")
def merge_sas_emoji_v1():
emoji = dict() # will be populated by a read
with open(os.path.join(data_defs_dir, "sas-emoji.json"), encoding="utf8") as f:
emoji = json.load(f)
for e in emoji:
e["translated_descriptions"] = dict()
pth = os.path.join(data_defs_dir, "sas-emoji-v1-i18n")
translations = [t for t in os.listdir(pth) if os.path.isfile(os.path.join(pth, t))]
for translation in translations:
if not translation.endswith(".json") or translation == "base.json":
continue
lang = translation[:-5] # trim off the json extension
with open(os.path.join(pth, translation), encoding="utf8") as lf:
descs = json.load(lf)
for e in emoji:
e["translated_descriptions"][lang] = descs[e["description"]]
with open(os.path.join(data_defs_dir, "sas-emoji.json"), mode="w+", encoding="utf8") as o:
json.dump(emoji, o, ensure_ascii=False, indent=4)
merge_sas_emoji_v1()

@ -770,6 +770,11 @@ Clients SHOULD show the emoji with the descriptions from the table, or appropria
translation of those descriptions. Client authors SHOULD collaborate to create a
common set of translations for all languages.
.. Note::
Known translations for the emoji are available from
https://github.com/matrix-org/matrix-doc/blob/master/data-definitions/ and can be
translated online: https://translate.riot.im/projects/matrix-doc/sas-emoji-v1
.. section name changed, so make sure that old links keep working
.. _key-sharing:

Loading…
Cancel
Save