Skip to content

Commit

Permalink
Merge pull request #124 from sveltekit-i18n/examples/rollback-parsers
Browse files Browse the repository at this point in the history
Rollback `parser` examples dependencies
  • Loading branch information
jarda-svoboda committed Jul 11, 2023
2 parents 3682a5d + 70dba68 commit 9ffca0d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions examples/parser-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"type": "module",
"dependencies": {
"@sveltekit-i18n/base": "^1.3.2",
"@sveltekit-i18n/parser-default": "^1.0.0"
"@sveltekit-i18n/base": "file:../../node_modules/@sveltekit-i18n/base",
"@sveltekit-i18n/parser-default": "file:../../node_modules/@sveltekit-i18n/parser-default"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"title_built-in": "Vestavěné modifikátory",
"title_custom": "Vlastní modifikátory",
"title_dynamic_default": "Proměnná výchozí hodnota",
"title_direct_input": "Přímý vstup",
"placeholder_simple": "Toto je {{placeholder}}",
"placeholder_default": "Toto je {{placeholder; default:výchozí hodnota.}}",
"modifier_eq_string": "{{value; male:On; female:Ona; default:Někdo}} má psa.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"title_built-in": "Built-in Modifiers",
"title_custom": "Custom Modifiers",
"title_dynamic_default": "Dynamic default",
"title_direct_input": "Direct input",
"placeholder_simple": "This is {{placeholder}}",
"placeholder_default": "This is {{placeholder; default:a default value.}}",
"modifier_eq_string": "{{value; male:He; female:She; default:No one}} has a dog.",
Expand Down
17 changes: 12 additions & 5 deletions examples/parser-default/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { locale, t } from '$lib/translations';
$: number = 10;
$: count = 1000;
const initTime = Date.now();
$: now = initTime;
Expand All @@ -14,6 +13,8 @@
const currency = 100;
const currencyRatio = { en: 1, cs: 22.4 };
$: direct = 'hardcoded';
</script>

<h1>{$t('content.title_placeholders')}</h1>
Expand All @@ -23,13 +24,14 @@

<h1>{$t('content.title_built-in')}</h1>
<div>
{$t('content.modifier_number', { count })}<br />
<button on:click="{() => {if (count) count -= 1;}}">–</button>
<button on:click="{() => {count += 1;}}">+</button>
{$t('content.modifier_number', { count: number })}<br />
<br>
<input type="number" bind:value="{number}" />
<button on:click="{() => {number -= 1;}}">–</button>
<button on:click="{() => {number += 1;}}">+</button>
</div>
<br />
<div>
<input type="number" bind:value="{number}" /><br />
{$t('content.modifier_eq', { value: number })}<br />
{$t('content.modifier_ne', { value: number })}<br />
{$t('content.modifier_lt', { value: number })}<br />
Expand Down Expand Up @@ -57,3 +59,8 @@
<button on:click="{() => {error = undefined;}}">(undefined)</button>
<br />
<p>{$t(`content.error.${error}`, { default: $t('content.error.default') })} ({error})</p>

<h1>{$t('content.title_direct_input')}</h1>
<button on:click="{() => {direct = 'hardcoded';}}">Hardcoded</button>
<button on:click="{() => {direct = 'dynamic';}}">Dynamic</button>
<p>{$t('This input is {{ value; }}!', { value: direct })}</p>
2 changes: 1 addition & 1 deletion examples/parser-icu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"type": "module",
"dependencies": {
"@sveltekit-i18n/base": "^1.3.2",
"@sveltekit-i18n/base": "file:../../node_modules/@sveltekit-i18n/base",
"@sveltekit-i18n/parser-icu": "^1.0.0"
}
}
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9ffca0d

Please sign in to comment.