Skip to content

Localizing the UI #5

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

Closed
1 of 3 tasks
rdipardo opened this issue Aug 7, 2023 · 6 comments
Closed
1 of 3 tasks

Localizing the UI #5

rdipardo opened this issue Aug 7, 2023 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rdipardo
Copy link
Owner

rdipardo commented Aug 7, 2023

A future version of HTML Tag will be adaptive to the user's language preferences.1 The most visible difference will be a localized command menu, e.g.

zh-CN he
de es-ar

As explained on the community forum, the main obstacle for now is a lack of first-class plugin integration. Detecting changed preferences currently requires an application restart. New APIs will probably be essential for any viable implementation. This issue will track any future developments in that area.

In the meantime, contributions to the following work items are welcome:

  • Improve and/or correct the currently available translations.

  • Add localizations for more languages. Parity with Notepad++ is out of the question, as it currently features 90+.
    The goal is for HTML Tag to support at least half of N++'s catalogue. About 40 would be a good milestone for an initial release.

    Completed

Footnotes

  1. Not including the About dialog, for a couple of reasons: 1) the text is hard-coded into the form's initialization routines; using resource files instead would bloat an otherwise lightweight component; 2) most of the text is informational and not easily translated.

@conky77
Copy link

conky77 commented Aug 4, 2024

@rdipardo
if I understood well, your plugin is translated in many languages, but it hasn't translatable yet.
For example If I enter in Italian, I can't see the translation.
Other plugins check the language when N++ starts: is it possible to do the same?

@rdipardo
Copy link
Owner Author

rdipardo commented Aug 5, 2024

@conky77

Other plugins check the language when N++ starts: is it possible to do the same?

A translatable version of HTML Tag is still in development; there's no published version to experiment with ('spiace!).

For now it can be tested like this:

  1. Visit https://app.circleci.com/pipelines/github/rdipardo/nppHTMLTag/5/workflows/fbeb8a55-2fd2-478b-9d04-dde827d1644f/jobs/5/artifacts
  2. Select "HTMLTag.dll" (64-bit), or "HTMLTag_unicode.dll" (32-bit)
  3. Replace your existing copy of the plugin module with the download
  4. Download and save the translations file to the same location as the plugin module $(NPP_LOCATION)\plugins\HTMLTag[_unicode]\HTMLTag-translations.ini
  5. If the native language is already configured, and the translations file has a key for the language, the plugin commands are translated at startup. There's currently no logic to change the menu during usage.

@rdipardo
Copy link
Owner Author

Version 1.5.0 includes an initial implementation of localized menus for 22 languages.

@rdipardo rdipardo removed this from the v1.5 milestone Oct 14, 2024
@conky77
Copy link

conky77 commented Oct 26, 2024

@rdipardo
with the last version of notepad++ and the last version of the plugin, the menu is not translated. I tried to switch to English, then Italian, close Np++: the menu is still in English
immagine

immagine

Notepad++ v8.7.1 (64-bit)
Build time : Oct 25 2024 - 04:07:21
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Home (64-bit)
OS Version : 23H2
OS Build : 22631.4317
Current ANSI codepage : 1252
Plugins :
ComparePlus (1.2)
DSpellCheck (1.5)
ERPHelper (1.1.2)
HexEditor (0.9.12)
HTMLTag (1.5)
JsonTools (8.1)
mimeTools (3.1)
MultiReplace (4.0.0.19)
NppConverter (4.6)
NppExport (0.4)
NPPJSONViewer (2.0.8)
NppMenuSearch (0.9.6)
NppPluginOpenHost (1.1)
PoorMansTSqlFormatterNppPlugin (1.6.13.31508)
SQLinFormNpp64 (6.24.7.15)
XMLTools (3.1.1.13)

@conky77
Copy link

conky77 commented Oct 26, 2024

Also another plugin "json tools" doesn't switch language, so maybe it depends on n++

@rdipardo
Copy link
Owner Author

@conky77

Local Conf mode : OFF

Mamma mia!

Localizations are working for portable Notepad++ only — i.e., your nativeLang.xml must be in $(LOCAL_NPP_DIR), not %AppData%\Notepad++:

path = pluginsHomeDir().parent_path() / path_t(L"nativeLang.xml");

The translation code does not run if nativeLang.xml isn't found:

// Always make sure that 'nativeLang.xml' exists
// https://github.com/notepad-plus-plus/notepad-plus-plus/commit/ea08a89
if (!std::filesystem::exists(getNativeLangFile()))
return;

You can use a development version for now. The fix will be in v1.5.1.

Also, plugin dialogs are not yet translatable; that's a bigger job and will need more translatations from native speakers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants