any-block / obsidian-any-block

A Obsidian Plugin. You can flexibility to create a 'Block' by some means. It also provides some useful features, like `list to table`.
https://linczero.github.io/MdNote_Public/ProductDoc/AnyBlock/
GNU Affero General Public License v3.0
197 stars 9 forks source link

Add the ability to create translations #100

Open Riffaells opened 5 days ago

Riffaells commented 5 days ago

I would like to make this plugin more multi-language

LincZero commented 4 days ago

Languages other than Chinese and English?

Riffaells commented 4 days ago

yes

LincZero commented 4 days ago

Do you have to translate the document first?

You can PR the repo: https://github.com/LincDocs/MdNote_Public/tree/main/ProductDoc/AnyBlock (The document is mixed with my personal notes, please don't mind)

LincZero commented 4 days ago

You can translate first, but don't PR yet. Let me see if I can change the structure of the library......

Originally for my own convenience to edit and facilitate the website to share, just put the document and personal notes together. I feel like maybe I should put it back in the docs folder of anyblock repo. Then modify the way the site is built

Riffaells commented 4 days ago

No, I'm not talking about the documentation, I'm talking about the translation of the plugin

LincZero commented 4 days ago

Not sure what you mean?

I don't know the way you want to translate. The translation of obsidian plug-in can almost only translate a version after fork, and there is no way to switch arbitrarily on the panel.

I don't know which places you want to translate. The description in the Settings panel is almost useless, just look up the table, basically no Settings. If you are just talking about the way it is used, you can use a preset set of alias aliases so that the plug-in can be called [other language description] without changing the plug-in. You can make aliases use this set of alias systems that use other languages by sharing the json file in the plugin folder

Riffaells commented 4 days ago

I'm not sure I fully understand what you're saying. I mean translating the plugin in the same way as, for example, Excalidraw (https://github.com/zsviczian/obsidian-excalidraw-plugin/tree/master/src/lang/locale). They have a helpers.ts file where available languages and their translations are listed. If a translation for a particular language is missing, English is used as the default.

My proposal is to implement a similar translation system for your plugin. This could involve creating localization files and a mechanism for language selection that users can change. This way, users can switch languages without the need for forking or manually modifying the plugin files.

LincZero commented 3 days ago

The main Settings panel has nothing to set up, and the current Settings panel is almost equivalent to a part of the document, and it is not a complete document.

The only setup item (AliasSystem) is also imperfect, and nobody uses it and I don't want to improve it. It is recommended to modify the data.json file directly.

I don't think the content on the Settings panel is worth translating.