Add norwegian translation (#757)

* feat: add norwegian translation

* arrange text in alphabetical order

* sort by code

* rename en.json to main.json

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
This commit is contained in:
Sigve Hansen 2022-06-26 17:42:56 +02:00 committed by GitHub
parent 5e2e23e6ce
commit 1a3cfa0c81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 105 additions and 11 deletions

View file

@ -7,8 +7,10 @@ export function useTranslation(code?: TDLanguage) {
const translation = TRANSLATIONS.find((t) => t.code === locale) const translation = TRANSLATIONS.find((t) => t.code === locale)
const defaultTranslation = TRANSLATIONS.find((t) => t.code === 'en')!
const messages = { const messages = {
...TRANSLATIONS[0].messages, ...defaultTranslation.messages,
...translation?.messages, ...translation?.messages,
} }

View file

@ -1,6 +1,6 @@
import * as React from 'react' import * as React from 'react'
import { IntlProvider } from 'react-intl' import { IntlProvider } from 'react-intl'
import messages_en from '~translations/en.json' import messages_en from '~translations/main.json'
import messages_fr from '~translations/fr.json' import messages_fr from '~translations/fr.json'
export const renderWithIntlProvider = (children: React.ReactNode) => { export const renderWithIntlProvider = (children: React.ReactNode) => {

View file

@ -0,0 +1,90 @@
{
"style.menu.color": "Farge",
"style.menu.fill": "Fyll",
"style.menu.dash": "Linje",
"style.menu.size": "Størrelse",
"style.menu.keep.open": "Hold åpen",
"style.menu.font": "Teksttype",
"style.menu.align": "Juster",
"styles": "Stiler",
"zoom.in": "Zoom inn",
"zoom.out": "Zoom ut",
"to": "til",
"to.selection": "Til valg",
"to.fit": "For å passe",
"menu.file": "Fil",
"menu.edit": "Rediger",
"menu.view": "Vis",
"menu.preferences": "Preferanser",
"menu.sign.in": "Logg inn",
"menu.sign.out": "Logg ut",
"sponsored": "Sponset",
"become.a.sponsor": "Bli en sponsor",
"zoom.to.selection": "Zoom til valg",
"zoom.to.fit": "Zoom for å passe",
"zoom.to": "Zoom til",
"preferences.dark.mode": "Mørk modus",
"preferences.focus.mode": "Fokus modus",
"preferences.debug.mode": "Debug modus",
"preferences.show.grid": "Vis rutenett",
"preferences.use.cad.selection": "Bruk CAD seleksjon",
"preferences.keep.stylemenu.open": "Hold stilmeny åpen",
"preferences.always.show.snaps": "Vis alltid snaps",
"preferences.rotate.handles": "Vis roteringshåndtak",
"preferences.binding.handles": "Vis bindingshåndtak",
"preferences.clone.handles": "Vis kloningshåndtak",
"undo": "Angre",
"redo": "Gjør om",
"cut": "Klipp ut",
"copy": "Kopier",
"paste": "Lim inn",
"copy.as": "Kopier som",
"export.as": "Eksporter som",
"select.all": "Velg alle",
"select.none": "Velg ingen",
"delete": "Slett",
"new.project": "Nytt prosjekt",
"open": "Åpne",
"save": "Lagre",
"save.as": "Lagre som",
"upload.media": "Last opp media",
"create.page": "Opprett side",
"new.page": "Ny side",
"page.name": "Sidenavn",
"duplicate": "Dupliser",
"cancel": "Avbryt",
"copy.invite.link": "Kopier invitasjonslink",
"create.multiplayer.project": "Opprett et flerspiller prosjekt",
"copy.multiplayer.project": "Kopier til flerspiller prosjekt",
"select": "Velg",
"eraser": "Viskelær",
"draw": "Tegn",
"arrow": "Pil",
"text": "Tekst",
"sticky": "Lapp",
"Rectangle": "Rektangel",
"Ellipse": "Ellipse",
"Triangle": "Trekant",
"Line": "Linje",
"rotate": "Roter",
"lock.aspect.ratio": "Lås størrelsesforhold",
"unlock.aspect.ratio": "Lås opp størrelsesforhold",
"group": "Grupper",
"ungroup": "Avgrupper",
"move.to.back": "Flytt bakerst",
"move.backward": "Flytt bakover",
"move.forward": "Flytt forover",
"move.to.front": "Flytt til front",
"reset.angle": "Tilbakestill vinkel",
"lock": "Lås",
"unlock": "Lås opp",
"move.to.page": "Flytt til side",
"flip.horizontal": "Snu horisontalt",
"flip.vertical": "Snu vertikalt",
"move": "Flytt",
"to.front": "Foran",
"forward": "Framover",
"backward": "Bakover",
"back": "Bakerst",
"language": "Språk"
}

View file

@ -1,10 +1,11 @@
import ar from './ar.json' import ar from './ar.json'
import en from './en.json' import en from './main.json'
import fr from './fr.json' import fr from './fr.json'
import it from './it.json' import it from './it.json'
import ko_kr from './ko-kr.json'
import zh_cn from './zh-cn.json'
import ja from './ja.json' import ja from './ja.json'
import ko_kr from './ko-kr.json'
import no from './no.json'
import zh_cn from './zh-cn.json'
// The default language (english) must have a value for every message. // The default language (english) must have a value for every message.
// Other languages may have missing messages. If the application finds // Other languages may have missing messages. If the application finds
@ -12,18 +13,19 @@ import ja from './ja.json'
// translation instead. // translation instead.
export const TRANSLATIONS: TDTranslations = [ export const TRANSLATIONS: TDTranslations = [
// Default language:
{ code: 'en', label: 'English', messages: en },
// Translations:
{ code: 'ar', label: 'عربي', messages: ar }, { code: 'ar', label: 'عربي', messages: ar },
{ code: 'en', label: 'English', messages: en },
{ code: 'fr', label: 'Français', messages: fr }, { code: 'fr', label: 'Français', messages: fr },
{ code: 'it', label: 'Italiano', messages: it }, { code: 'it', label: 'Italiano', messages: it },
{ code: 'ko-kr', label: '한국어', messages: ko_kr },
{ code: 'zh-cn', label: 'Chinese - Simplified', messages: zh_cn },
{ code: 'ja', label: '日本語', messages: ja }, { code: 'ja', label: '日本語', messages: ja },
{ code: 'ko-kr', label: '한국어', messages: ko_kr },
{ code: 'no', label: 'Norwegian', messages: no },
{ code: 'zh-cn', label: 'Chinese - Simplified', messages: zh_cn },
] ]
/* ---------- Derived Types (do not change) --------- */ /* ----------------- (do not change) ---------------- */
TRANSLATIONS.sort((a, b) => (a.code < b.code ? -1 : 1))
export type TDTranslation = { export type TDTranslation = {
readonly code: string readonly code: string