Created
November 6, 2018 10:42
-
-
Save mutaphysis/153abae48b3c4c591403df1eb596b872 to your computer and use it in GitHub Desktop.
Link Translation snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const keys = [{ | |
"label" : "Travel guide", | |
"url" : "https://travelable.info/" | |
}, | |
{ | |
"label" : "Get involved", | |
"url" : "https://news.wheelmap.org/en/wheelmap-ambassador/" | |
}, | |
{ | |
"label" : "News", | |
"url" : "https://news.wheelmap.org/en/#news" | |
}, | |
{ | |
"label" : "Press", | |
"url" : "https://news.wheelmap.org/en/press/" | |
}, | |
{ | |
"label" : "Contact", | |
"url" : "https://news.wheelmap.org/en/contact/" | |
}, | |
{ | |
"label" : "Imprint", | |
"url" : "https://news.wheelmap.org/en/imprint/" | |
}, | |
{ | |
"label" : "FAQ", | |
"url" : "https://news.wheelmap.org/en/FAQ/" | |
}]; | |
for (const lang in translations) { | |
const t = translations[lang]; | |
addLocale(t.headers.language, t); | |
} | |
const results = keys.map((element, index) => { | |
const result = { | |
order: index, | |
appId: "wheelmap.tech", | |
label: {}, | |
url: { | |
en_US: element.url, | |
} | |
} | |
for (const lang in translations) { | |
const t = translations[lang]; | |
useLocales([t.headers.language]); | |
result.label[t.headers.language] = gettext(element.label) | |
} | |
return result; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment