Skip to content

Commit

Permalink
locale
Browse files Browse the repository at this point in the history
  • Loading branch information
TadaTeruki committed May 27, 2024
1 parent a272f46 commit 4f02c88
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions frontend/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

<style>
@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');
:global(:root.light) {
--page-bg: #fafafa;
Expand Down Expand Up @@ -86,7 +85,7 @@
display: flex;
flex-direction: row;
align-items: center;
font-family: 'Roboto', 'Zen Kaku Gothic New', sans-serif;
font-family: 'Zen Kaku Gothic New', sans-serif;
width: 100vw;
height: 100vh;
background-color: var(--page-bg);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
});
async function generateNew(presetSeed?: number) {
if (presetSeed) {
if (presetSeed !== undefined) {
seed = presetSeed;
} else {
seed = Math.floor(Math.random() * 1000000) + 1;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/routes/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { initialSettingsStore, placenameDatasetStore } from './store';
export async function load(event: any) {
const params = new URLSearchParams(event.url.search);
const localeSrc = params.get('locale');
const locale = localeSrc ? localeSrc : getLocaleFromNavigator() || 'en';
let locale = localeSrc ? localeSrc : getLocaleFromNavigator() || 'en';
locale = locale.split('-')[0];
setupI18n(locale);

const initialSeedSrc = params.get('seed');
Expand Down

0 comments on commit 4f02c88

Please sign in to comment.