-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(i18n): add translation builder and globals for romanian
Co-authored-by: Christian Eichert <102165928+ecxod@users.noreply.github.com> Co-authored-by: Simona Iacob <s@zp1.net> Co-authored-by: Jakob Schnell <koebi@ezelo.de>
- Loading branch information
1 parent
fe96600
commit 3b96348
Showing
3 changed files
with
155 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* eslint-disable no-undef */ | ||
import global from './global.js' | ||
import loader from '@/support/loader' | ||
|
||
/** | ||
* Fetch required api data to run the app | ||
*/ | ||
const build = () => { | ||
// RO LANGUAGE | ||
|
||
let translationsObj = global | ||
|
||
const componentMessages = loader.load(require.context('@/pages/', true, /\.i18n\.ro-ro\.js$/), true) | ||
addComponentKeys(componentMessages, translationsObj) | ||
|
||
const sharedPartsMessages = loader.load(require.context('@/fragments/', true, /\.i18n\.ro-ro\.js$/), true) | ||
addComponentKeys(sharedPartsMessages, translationsObj) | ||
|
||
const resourcesMessages = loader.load(require.context('@/resources/', true, /\.i18n\.ro-ro\.js$/), true) | ||
addComponentKeys(resourcesMessages, translationsObj) | ||
|
||
const pluginsMessages = loader.load(require.context('@/plugins/', true, /\.i18n\.ro-ro\.js$/), true) | ||
addComponentKeys(pluginsMessages, translationsObj) | ||
|
||
return translationsObj | ||
} | ||
|
||
const addComponentKeys = (localeSharedPartsMessages, translationsObj) => { | ||
for (let messages in localeSharedPartsMessages) { | ||
let translations = localeSharedPartsMessages[messages] | ||
for (var key in translations) { | ||
// Skip loop if the property is from prototype | ||
if (!Object.prototype.hasOwnProperty.call(translations, key)) continue | ||
translationsObj[key] = translations[key] | ||
} | ||
} | ||
} | ||
|
||
|
||
const translationsBuilder = { | ||
build, | ||
} | ||
|
||
export default translationsBuilder |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
export default { | ||
'global': { | ||
'send': 'Trimiteți', | ||
'save': 'Salvați', | ||
'confirm': 'Confirmați', | ||
'cancel': 'Anulați', | ||
'brand': 'HeiGIT - Universitatea din Heidelberg', | ||
'close': 'Închideți', | ||
'closeAndDoNotShowAgain': 'Închideți și nu afișați din nou', | ||
'select': 'Selectați', | ||
'yes': 'Da', | ||
'no': 'Nu', | ||
'and': 'și', | ||
'noAndDonAskAgain': 'NU (nu întrebați din nou)', | ||
'ok': 'OK', | ||
'polygon': 'poligon', | ||
'developedByIntro': 'Servicii dezvoltate de', | ||
'developedBy': 'Institutul Heidelberg pentru tehnologia geoinformațiilor', | ||
'duration': 'Durată', | ||
'distance': 'Distanță', | ||
'elevation': 'Elevație', | ||
'profile': 'Profil', | ||
'options': 'Opțiuni', | ||
'parameters': 'Parametrii', | ||
'custom': 'Personalizat', | ||
'customOverlayer': 'Strat de acoperire personalizat', | ||
'rawRouting': 'Traseu brut', | ||
'months': { | ||
'january': 'Ianuarie', | ||
'february': 'Februarie', | ||
'march': 'Martie', | ||
'april': 'Aprilie', | ||
'may': 'Mai', | ||
'june': 'Iunie', | ||
'july': 'Iulie', | ||
'august': 'August', | ||
'september': 'Septembrie', | ||
'october': 'Octombrie', | ||
'november': 'Noiembrie', | ||
'december': 'Decembrie' | ||
}, | ||
'monthsShort': { | ||
'january': 'Ian', | ||
'february': 'Feb', | ||
'march': 'Mar', | ||
'april': 'Apr', | ||
'may': 'Mai', | ||
'june': 'Iun', | ||
'july': 'Iul', | ||
'august': 'Aug', | ||
'september': 'Sep', | ||
'october': 'Oct', | ||
'november': 'Nov', | ||
'december': 'Dec' | ||
}, | ||
'units': { | ||
'm': 'm', | ||
'minutes': 'minute', | ||
'km': 'km(s)', | ||
'mi': 'mi(s)', | ||
'seconds': 'secunde', | ||
's': 's', | ||
'hours': 'oră(e)', | ||
'days': 'd', | ||
'h': 'h', | ||
'min': 'min', | ||
'meters': 'metri', | ||
'lat': 'latitudine', | ||
'lng': 'longitudine', | ||
'tones': 'tonuri', | ||
't': 't', | ||
'kmh': 'km/h' | ||
}, | ||
'layers': { | ||
'region': 'Regiune', | ||
'macrocounty': 'Macro județ', | ||
'country': 'Țara', | ||
'county': 'Județ', | ||
'macroregion': 'Macro regiune', | ||
'neighbourhood': 'Vecinătate', | ||
'locality': 'Localitate', | ||
'borough': 'Orășel', | ||
'localadmin': 'Administrator local', | ||
'address': 'Adresă', | ||
'notAvailable': 'Nu este disponibil', | ||
'undefined': 'Nedefinit', | ||
'street': 'Stradă', | ||
'venue': 'Locația', | ||
'rawCoordinate': 'Coordonate brute lng,lat', | ||
'postalcode': 'Cod poștal', | ||
'ocean': 'Oceanul' | ||
}, | ||
'population': 'Populația', | ||
'roadaccessrestrictions': 'Restricții de acces la drumuri', | ||
'green': 'Verde', | ||
'noise': 'Zgomot', | ||
'steepness': 'Abrupt', | ||
'surface': 'Suprafață', | ||
'waytypes': 'Tipuri de căi', | ||
'suitability': 'Adecvare', | ||
'waycategory': 'Categoria Calea', | ||
'tollways': 'Autostrăzi cu taxă', | ||
'traildifficulty': 'Dificultatea traseului', | ||
'osmid': 'OSM ID', | ||
'countryinfo': 'Informații despre țară' | ||
} | ||
} |