[F/OS] ThMLT - An extension to make translation and text styling easier

The acronym "ThMLT" stands for "Theme and Multilanguage Translation." It represents a component designed to manage themes (such as colors and fonts) and facilitate multilanguage support (translation) in AI2.

This extension offers a straightforward solution that I've been using in my personal projects. Recognizing its potential value to the broader community, I've opted to share it. I hope this extension proves beneficial to others.

Blocks

Usage

colorScheme
You can use any letter as a key. But
p = ColorPrimary
s = ColorSecondary
a = ColorAccent

fonts
You can use any letter as key.
Except
r = FontRegular
b = FontBold
i = FontItalic
m = FontMaterial
If you want the bold/italic font to be the same as the regular font, set the value to "r" in your fonts value.

These keys will trigger the property blocks for Color and Fonts

translationFiles
Add your translation files as a JSON text

defaultLanguage
You can set default language for translation

In the label text:

  1. Begin with {-
  2. If you wish to translate the label, use "t"; otherwise, use "n"
  3. Add your font key, such as "r" for regular
  4. Similarly, specify the color, like "p" for primary
  5. Conclude with }
  6. Next, include your text. To facilitate translation, use the same key as in the JSON file.
    In my case it is {-trp}name

V1 - com.hridoy.thmlt.aix (13.0 KB)
AIA - ThMLT_Test.aia (267.6 KB)

Open Source

3 Likes