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 <lucas.bisgaard@kraftvaerk.com>
Co-authored-by: leekelleher <leekelleher@gmail.com>
This commit is contained in:
Lucas Bach Bisgaard
2025-07-29 19:01:22 +02:00
committed by GitHub
parent fb9a9b38a8
commit 34989307db
3 changed files with 6 additions and 2 deletions

View File

@@ -2823,6 +2823,8 @@ export default {
charmap_extlatin: 'Udvidet latinsk',
charmap_symbols: 'Symboler',
charmap_arrows: 'Pile',
statusbar_characters: (count: number) => `${count.toLocaleString()} tegn`,
statusbar_words: (count: number) => `${count.toLocaleString()} ord`,
},
collection: {
noItemsTitle: 'Intet indhold',

View File

@@ -2812,6 +2812,8 @@ export default {
charmap_extlatin: 'Extended Latin',
charmap_symbols: 'Symbols',
charmap_arrows: 'Arrows',
statusbar_characters: (count: number) => `${count.toLocaleString()} ${count === 1 ? 'character' : 'characters'}`,
statusbar_words: (count: number) => `${count.toLocaleString()} ${count === 1 ? 'word' : 'words'}`,
},
linkPicker: {
modalSource: 'Source',

View File

@@ -41,8 +41,8 @@ export class UmbTiptapStatusbarWordCountElement extends UmbLitElement {
override render() {
const label = this._showCharacters
? this._characters.toLocaleString() + ' ' + (this._characters === 1 ? 'character' : 'characters')
: this._words.toLocaleString() + ' ' + (this._words === 1 ? 'word' : 'words');
? this.localize.term('tiptap_statusbar_characters', this._characters)
: this.localize.term('tiptap_statusbar_words', this._words);
return html`<uui-button compact label=${label} @click=${this.#onClick}></uui-button>`;
}
}