Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
fix: fix korean language
Browse files Browse the repository at this point in the history
  • Loading branch information
Frecherenkel60 committed Jul 13, 2023
1 parent 25f314e commit 3145e5e
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"languages": {
"en": "Englisch",
"de": "Deutsch",
"kor": "Koreanisch"
"ko": "Koreanisch"
},
"logout": "Abmelden",
"search": "Durchsuche deine Reisen..."
Expand Down
2 changes: 1 addition & 1 deletion languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"header": {
"languages": {
"en": "English",
"kor": "Korean",
"ko": "Korean",
"de": "German"
},
"logout": "Logout",
Expand Down
2 changes: 1 addition & 1 deletion languages/kor.json → languages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"languages": {
"en": "엉어",
"de": "독일어",
"kor": "한국어"
"ko": "한국어"
},
"logout": "로그아웃",
"search": "여행 겁색..."
Expand Down
5 changes: 3 additions & 2 deletions src/components/general/_LanguageSelector.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts">
import { i, language, loadResource, switchLanguage } from '@inlang/sdk-js';
import { ListBox, ListBoxItem, popup, type PopupSettings } from '@skeletonlabs/skeleton';
import { De, Us, Kr } from 'svelte-flag-icons';
import { De, Kr, Us } from 'svelte-flag-icons';
let languages = [
{ id: 'en', title: i('header.languages.en'), icon: Us },
{ id: 'kor', title: i('header.languages.kor'), icon: Kr },
{ id: 'ko', title: i('header.languages.ko'), icon: Kr },
{ id: 'de', title: i('header.languages.de'), icon: De }
];
Expand All @@ -29,6 +29,7 @@
const switchLanguageHandler = async (e: MouseEvent) => {
const value = (e.target as HTMLButtonElement).value;
console.log(`Switching language to: ${value}`);
await switchLanguage(value);
// Switch language titles for the current language
Expand Down
7 changes: 4 additions & 3 deletions src/components/history/_HistoryItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import { ParticipantIconDebt } from '$components';
import type { Transaction } from '$tripDomain';
import { calculateDate } from '$utils';
import { language } from '@inlang/sdk-js';
import { i, language } from '@inlang/sdk-js';
import { ArrowLongRight } from '@steeze-ui/heroicons';
import { Icon } from '@steeze-ui/svelte-icon';
import { i } from '@inlang/sdk-js';
export let transaction: Transaction;
Expand All @@ -18,9 +17,11 @@
[key: string]: string;
en: string;
de: string;
ko: string;
} = {
en: 'en-US',
de: 'de-de'
de: 'de-de',
ko: 'ko-KR'
};
$: dateFormat = dateFormats[language];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<script lang="ts">
import type { CostDateAsString } from '$tripDomain';
import { calculateDate, pickTextColorBasedOnBgColorSimple } from '$utils';
import { language, i } from '@inlang/sdk-js';
import { i, language } from '@inlang/sdk-js';
export let cost: CostDateAsString;
const dateFormats: {
[key: string]: string;
en: string;
de: string;
ko: string;
} = {
en: 'en-US',
de: 'de-de'
de: 'de-de',
ko: 'ko-KR'
};
// get the date format based on the current language
Expand Down
4 changes: 3 additions & 1 deletion src/components/tripDetails/_CostItemTripDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
[key: string]: string;
en: string;
de: string;
ko: string;
} = {
en: 'en-US',
de: 'de-de'
de: 'de-de',
ko: 'ko-KR'
};
// get the date format based on the current language
Expand Down
4 changes: 3 additions & 1 deletion src/components/tripDetails/_ParticipantIcon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
[key: string]: string;
en: string;
de: string;
ko: string;
} = {
en: 'en-US',
de: 'de-de'
de: 'de-de',
ko: 'ko-KR'
};
// get the date format based on the current language
Expand Down
4 changes: 3 additions & 1 deletion src/components/tripOverview/_TripInfos.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
[key: string]: string;
en: string;
de: string;
ko: string;
} = {
en: 'en-US',
de: 'de-de'
de: 'de-de',
ko: 'ko-KR'
};
// get the date format based on the current language
Expand Down
5 changes: 3 additions & 2 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const unauthorizedRoutes = [
'/api/users/verify-reset-token', // Verify reset token API
'/api/users/reset-password', // Reset password API
'/inlang/en.json', // Inlang API for English
'/inlang/de.json' // Inlang API for German
'/inlang/de.json', // Inlang API for German
'/inlang/ko.json' // Inlang API for Korean
];

export const handle: Handle = async ({ event, resolve }) => {
Expand Down Expand Up @@ -94,7 +95,7 @@ export const handleFetch: HandleFetch = ({ event, request, fetch }) => {
console.log(`Outgoing request to ${url}`);

if (PUBLIC_BASE_URL === url.origin) {
request.headers.set('Authorization', event.request.headers.get('Authorization') || '');
request.headers.set('Authorization', event.request.headers.get('Authorization') ?? '');
}

return fetch(request);
Expand Down
4 changes: 3 additions & 1 deletion src/routes/(app)/profile/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
[key: string]: string;
en: string;
de: string;
ko: string;
} = {
en: 'en-US',
de: 'de-de'
de: 'de-de',
ko: 'ko-KR'
};
// get the date format based on the current language
Expand Down

0 comments on commit 3145e5e

Please sign in to comment.