Skip to content

Commit

Permalink
implement i18n-wrapper and update widgets.pot
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Apr 25, 2024
1 parent a1b4367 commit 3463af6
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ msgstr ""
`;

const okayFiles = ["xml", "js", "htm", "html"];
const okayFiles = ["xml", "js", "htm", "html", "svelte"];
const found = [];
const checkFile = function (filepath) {
const split = filepath.split(".");
Expand Down
9 changes: 5 additions & 4 deletions src/pat/contentbrowser/src/ContentBrowser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { clickOutside } from "./clickOutside";
import { resolveIcon } from "./resolveIcon.js";
import Upload from "../../upload/upload";
import _t from "../../../core/i18n-wrapper";
// import Keydown from "svelte-keydown";
Expand Down Expand Up @@ -165,7 +166,7 @@
>
</div>
{#await $contentItems}
<p>...loading content items</p>
<p>{_t("loading content items")}</p>
{:then levels}
<div class="levelColumns">
{#each levels as level, i (level.path)}
Expand All @@ -192,7 +193,7 @@
disabled={!isSelectable(level)}
on:click|preventDefault={() => selectItem(level)}
>
select {level.path}
{_t("select ${level_path}", {level_path: level.path})}
</button>
{/if}
<div class="levelActions">
Expand Down Expand Up @@ -268,7 +269,7 @@
{/each}
{#if level.total == 0}
<div class="contentItem">
<p>no items found.</p>
<p>{_t("no results found")}</p>
</div>
{/if}
</div>
Expand All @@ -281,7 +282,7 @@
disabled={!isSelectable(previewItem)}
on:click|preventDefault={() =>
selectItem(previewItem)}
>select "{previewItem.path.split("/").pop()}"</button
>{_t('select "${preview_path}"', {preview_path: previewItem.path.split("/").pop()})}</button
>
</div>
<div class="info">
Expand Down
5 changes: 3 additions & 2 deletions src/pat/contentbrowser/src/ContentStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default function (config, pathCache) {
}

const search = async (portalPath, searchTerm) => {
let level = {};
let query = {
method: "GET",
vocabularyUrl: config.vocabularyUrl,
Expand All @@ -88,7 +87,9 @@ export default function (config, pathCache) {
if (config.selectableTypes.length) {
query["selectableTypes"] = config.selectableTypes;
}
level = await request(query);
let level = await request(query);
level.selectable = false;
level.gridView = false;
store.set([level, ]);
}

Expand Down
5 changes: 3 additions & 2 deletions src/pat/contentbrowser/src/SelectedItems.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { request } from "./api.js";
import { resolveIcon } from "./resolveIcon.js";
import Sortable from "sortablejs";
import _t from "../../../core/i18n-wrapper";
let ref;
let initializing = true;
Expand Down Expand Up @@ -151,7 +152,7 @@
{/each}
{/if}
{#if !$selectedItems}
<p>loading selected items</p>
<p>{_t("loading selected items")}</p>
{/if}
</div>
<button
Expand All @@ -160,7 +161,7 @@
disabled={$config.maximumSelectionSize > 0 &&
($selectedItems.length || 0) >= $config.maximumSelectionSize}
on:click|preventDefault={() => ($showContentBrowser = true)}
>{#if $config.maximumSelectionSize == 1}choose{:else}add{/if}</button
>{_t("Select")}</button
>
</div>
Expand Down
36 changes: 28 additions & 8 deletions widgets.pot
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ msgstr ""
"Preferred-Encodings: utf-8\n"
"Domain: widgets\n"

#: ./src/pat/contentbrowser/src/ContentBrowser.svelte
msgid "loading content items"
msgstr ""

#: ./src/pat/contentbrowser/src/ContentBrowser.svelte
msgid "select ${level_path}"
msgstr ""

#: ./src/pat/contentbrowser/src/ContentBrowser.svelte
msgid "no results found"
msgstr ""

#: ./src/pat/contentbrowser/src/ContentBrowser.svelte
msgid "select ${preview_path}"
msgstr ""

#: ./src/pat/contentbrowser/src/SelectedItems.svelte
msgid "loading selected items"
msgstr ""

#: ./src/pat/contentbrowser/src/SelectedItems.svelte
msgid "Select"
msgstr ""

#: ./src/pat/formunloadalert/formunloadalert.js
msgid "Discard changes? If you click OK, any changes you have made will be lost."
msgstr ""
Expand All @@ -33,10 +57,6 @@ msgstr ""
msgid "enter search phrase"
msgstr ""

#: ./src/pat/livesearch/livesearch.js
msgid "no results found"
msgstr ""

#: ./src/pat/livesearch/livesearch.js
msgid "found"
msgstr ""
Expand Down Expand Up @@ -345,10 +365,6 @@ msgstr ""
msgid "Title"
msgstr ""

#: ./src/pat/structure/templates/tablerow.xml
msgid "Select"
msgstr ""

#: ./src/pat/structure/templates/tablerow.xml
msgid "Excluded from navigation"
msgstr ""
Expand All @@ -369,6 +385,10 @@ msgstr ""
msgid "Insert Image"
msgstr ""

#: ./src/pat/tinymce/tinymce--implementation.js
msgid "Insert table with header row"
msgstr ""

#: ./src/pat/tinymce/tinymce.js
msgid "Search for item on site..."
msgstr ""
Expand Down

0 comments on commit 3463af6

Please sign in to comment.