Skip to content

Commit

Permalink
i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed May 18, 2024
1 parent c2ce823 commit ad00a5b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
4 changes: 4 additions & 0 deletions i18n/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"field.csv.empty": "Wähle die CSV-Datei aus oder lade sie hoch",
"field.csv.loading": "Lade Tabelle…"
}
4 changes: 4 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"field.csv.empty": "Select or upload CSV file",
"field.csv.loading": "Loading table…"
}
15 changes: 15 additions & 0 deletions i18n/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

use Kirby\Filesystem\Dir;
use Kirby\Filesystem\F;

$translations = [];

foreach (Dir::files(__DIR__) as $file) {
$locale = basename($file, '.json');
if ($content = F::read(__DIR__ . '/' . $file)) {
$translations[$locale] = json_decode($content, true);
}
}

return $translations;
2 changes: 1 addition & 1 deletion index.js

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

3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@ function csv(string $file, string $delimiter = ','): array

return [];
}
]
],
'translations' => require_once __DIR__ . '/i18n/index.php'
]);
4 changes: 2 additions & 2 deletions src/CsvField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
/>
<k-empty
v-else-if="file"
text="Loading table…"
:text="$t('field.csv.loading')"
icon="loader"
layout="table"
/>
<k-empty
v-else
:text="$t('field.csv.empty')"
icon="table"
layout="table"
text="Select or upload CSV file"
@click="open"
/>
</k-dropzone>
Expand Down

0 comments on commit ad00a5b

Please sign in to comment.