Skip to content

Commit 3498930

Browse files
rammi987Lucas Bach Bisgaardleekelleher
authored
Change hardcoded text to be translatedeable (#19745)
* Change hardcoded text to be translatedeable * Added the `count` value to the localization --------- Co-authored-by: Lucas Bach Bisgaard <[email protected]> Co-authored-by: leekelleher <[email protected]>
1 parent fb9a9b3 commit 3498930

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/Umbraco.Web.UI.Client/src/assets/lang/da.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,6 +2823,8 @@ export default {
28232823
charmap_extlatin: 'Udvidet latinsk',
28242824
charmap_symbols: 'Symboler',
28252825
charmap_arrows: 'Pile',
2826+
statusbar_characters: (count: number) => `${count.toLocaleString()} tegn`,
2827+
statusbar_words: (count: number) => `${count.toLocaleString()} ord`,
28262828
},
28272829
collection: {
28282830
noItemsTitle: 'Intet indhold',

src/Umbraco.Web.UI.Client/src/assets/lang/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,8 @@ export default {
28122812
charmap_extlatin: 'Extended Latin',
28132813
charmap_symbols: 'Symbols',
28142814
charmap_arrows: 'Arrows',
2815+
statusbar_characters: (count: number) => `${count.toLocaleString()} ${count === 1 ? 'character' : 'characters'}`,
2816+
statusbar_words: (count: number) => `${count.toLocaleString()} ${count === 1 ? 'word' : 'words'}`,
28152817
},
28162818
linkPicker: {
28172819
modalSource: 'Source',

src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/statusbar/word-count.tiptap-statusbar-element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export class UmbTiptapStatusbarWordCountElement extends UmbLitElement {
4141

4242
override render() {
4343
const label = this._showCharacters
44-
? this._characters.toLocaleString() + ' ' + (this._characters === 1 ? 'character' : 'characters')
45-
: this._words.toLocaleString() + ' ' + (this._words === 1 ? 'word' : 'words');
44+
? this.localize.term('tiptap_statusbar_characters', this._characters)
45+
: this.localize.term('tiptap_statusbar_words', this._words);
4646
return html`<uui-button compact label=${label} @click=${this.#onClick}></uui-button>`;
4747
}
4848
}

0 commit comments

Comments
 (0)