-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added English texts in en.json
#2098
base: staging
Are you sure you want to change the base?
Conversation
They're not original text and does not fit all the text shown in the webpage. |
@Touch-Night Good idea! |
Note: not all |
"en" is intentionally left empty. Having to update texts both in HTML and JSON is going to make development more cumbersome and directly impact a delivery of new features. |
Instead of making it affect the localization files - make it able to find missing key placeholders to already existing localization files. |
But translators can be more cumbersome if there's no a full list of key: "original text" because we have to go through every page to find out which one are not translated and what's its key. Can't you make ST read original text from en.json, or just give us a need_to_be_translated.json file only for reference so we can translate ST 100%? |
@Touch-Night Do you mean the order in the translation JSON file matters? It's a bit strange. |
I find there are 3 cases for the
const footerHtml = `
<div class="${this.configuration.prefix}prompt_manager_footer">
<select id="${this.configuration.prefix}prompt_manager_footer_append_prompt" class="text_pole" name="append-prompt">
${promptsHtml}
</select>
<a class="menu_button fa-chain fa-solid" title="Insert prompt" data-i18n="[title]Insert prompt"></a>
<a class="caution menu_button fa-x fa-solid" title="Delete prompt" data-i18n="[title]Delete prompt"></a>
<a class="menu_button fa-file-import fa-solid" id="prompt-manager-import" title="Import a prompt list" data-i18n="[title]Import a prompt list"></a>
<a class="menu_button fa-file-export fa-solid" id="prompt-manager-export" title="Export this prompt list" data-i18n="[title]Export this prompt list"></a>
<a class="menu_button fa-undo fa-solid" id="prompt-manager-reset-character" title="Reset current character" data-i18n="[title]Reset current character"></a>
<a class="menu_button fa-plus-square fa-solid" title="New prompt" data-i18n="[title]New prompt"></a>
</div>
`; For the first and second cases, it is easy to extract English texts by parsing HTML using Fortunately, we only have about 20 key-value pairs in the 3rd case and it is okay to manually copy them to the JSON file. I would like to mention my current progress here. If we think adding |
en.json was present in the past but was emptied as it was annoying to work with - you have to go and change the text if you change it in the HTML, it is not convenient for developers and contributors who are working on new features. A script that will fill out the localization JSON files with the string keys to translate will be nice. But I'm actually thinking about an alternative to JSON that supports files - export const i18n = {
// original value
"key text": "翻译",
// ...etc
}; This would require a slight rework of the i18n loader, however. |
I think it would be better to create a template.js that won't be used directly. This way, managing translations in the future will be easier and it won't interfere with the English interface. |
This still raises the question of who would be responsible for maintaining this template in an up-to-date state. |
Related to #2074
Could anybody check if there are any typos?