[F/OS] ThMLT [v3.0.0] + Chrome Extension

ThMLT Logo

🧩 ThMLT

:memo: Specifications

Package

Size

Version

Min API

Updated

License: MIT

Built with FAST

ThMLT (Theme & Multilanguage Translation) is an advanced extension for App Inventor 2 (AI2) that streamlines theme management (colors & fonts) and enables seamless multilanguage support across your AI2 project.


:clipboard: Overview

  1. Key Features
  2. Guidelines

:jigsaw: Blocks

Methods

:purple_square: Initialize

Purpose: Initializes and loads data for color themes, fonts, and translations.

Initialize_Method

Parameter Type
colorThemes text
fonts text
translations text

:wrench: Need help configuring your Translations, Fonts, or Colors?

:open_book: Follow the official Data Configuration Guide β†’ to set up your JSON schemas correctly.


:purple_square: ApplyFormatting

Purpose: Applies formatting to a layout using the active theme and language.

ApplyFormatting_Method

Parameter Type
layout component

:purple_square: ApplyCustomizedFormatting

Purpose: Applies formatting to a layout using a specific theme and language.

ApplyCustomizedFormatting_Method

Parameter Type
layout component
themeMode text
languageCode text

:purple_square: Get

Purpose: Retrieves a list of values for a given data category.

Get_Method

Parameter Type
data All (helper enums)

Return: list
Why: Returns the complete list of items for enums like PrimitiveKeys, SemanticKeys, ThemeModes, FontTags, FontShortTags, TranslationKeys, SupportedLanguages.


:purple_square: GetTranslation

Purpose: Returns a translation for a given key using the active language.

GetTranslation_Method

Parameter Type
translationKey text

Return: text
Why: Returns the corresponding translation string, or Not Found if missing.


:purple_square: GetFont

Purpose: Returns a font name for a given key using the tag.

GetFont_Method

Parameter Type
tag text

Return: text
Why: Returns the corresponding font name, or Font not found if missing.


:purple_square: GetTranslationForLanguage

Purpose: Returns a translation for a key in a specific language.

GetTranslationForLanguage_Method

Parameter Type
translationKey text
languageCode text

Return: text
Why:

  • Returns the translation string if found.
  • Returns Not Found if the key is missing.
  • Returns 'languageCode' is not supported if the languageCode is invalid.

:purple_square: GetPrimitiveColor

Purpose: Retrieves a primitive color as an integer value.

GetPrimitiveColor_Method

Parameter Type
key text

Return: number
Why:

  • Returns the integer color value if key exists.
  • Returns -1 if not found (error condition).

:purple_square: GetSemanticColorSource

Purpose: Retrieves the source reference of a semantic color for the active theme.

GetSemanticColorSource_Method

Parameter Type
key text

Return: text
Why:

  • Returns the primitive color key.
  • Returns a detailed error if the theme or key doesn't exist.

:purple_square: GetSemanticColor

Purpose: Retrieves a semantic color value (int) for the active theme mode.

GetSemanticColor_Method

Parameter Type
key text

Return: number
Why:

  • Returns resolved color as int if found.
  • Returns -1 if theme mode or color key is invalid.

:purple_square: GetSemanticColorByThemeMode

Purpose: Retrieves a semantic color value for a specific theme mode.

GetSemanticColorByThemeMode_Method

Parameter Type
key text
themeMode text

Return: number
Why:

  • Returns resolved color as int if key exists in the given mode.
  • Returns -1 for missing theme/key.
Properties

:wrench: Setters

:green_square: FontRegular

Sets the regular font.

FontRegular_Set_Property

Input Type
font text

:green_square: FontBold

Sets the bold font.

FontBold_Set_Property

Input Type
font text

:green_square: FontMaterial

Sets the material icon font.

FontMaterial_Set_Property

Input Type
font text

:green_square: ColorPrimary

Sets the primary color.

ColorPrimary_Set_Property

Input Type
color number

:green_square: ColorSecondary

Sets the secondary color.

ColorSecondary_Set_Property

Input Type
color number

:green_square: ColorAccent

Sets the accent color.

ColorAccent_Set_Property

Input Type
color number

:green_square: Language

Sets the active translation language.

Language_Set_Property

Input Type
code text

:green_square: ThemeMode

Sets the active theme mode (e.g., light, dark).

ThemeMode_Set_Property

Input Type
mode text

:mag: Getters

:green_square: FontRegular

Gets the regular font.

FontRegular_Get_Property

Return Type
font text

:green_square: FontBold

Gets the bold font.

FontBold_Get_Property

Return Type
font text

:green_square: FontMaterial

Gets the material font.

FontMaterial_Get_Property

Return Type
font text

:green_square: ColorPrimary

Gets the primary color.

ColorPrimary_Get_Property

Return Type
color number

:green_square: ColorSecondary

Gets the secondary color.

ColorSecondary_Get_Property

Return Type
color number

:green_square: ColorAccent

Gets the accent color.

ColorAccent_Get_Property

Return Type
color number

:green_square: Language

Gets the current language code.

Language_Get_Property

Return Type
code text

:green_square: ThemeMode

Gets the current theme mode.

ThemeMode_Get_Property

Return Type
mode text
Events

:yellow_square: ErrorOccurred

Occurs when an error happens

ErrorOccurred_Event

Parameter Type
errorFrom text
error text

:rocket: Usage

Get started with ThMLT in just 3 simple steps β€” initialize once, format anywhere, and apply your style across the app.


:one: :green_circle: Initialize ThMLT (One-Time Setup)

Set up ThMLT with a single block β€” no repeated calls needed.

Use the Initialize block on any screen (commonly Screen1). ThMLT handles global data sync across all screens automatically.

:white_check_mark: Best Practice: Call it inside the Screen.Initialize block for consistent behavior across the app.

Initialize_Method_On_Screen_Initialize

:wrench: Need help configuring your Fonts, Colors, or Translations?

:open_book: Follow the official Data Configuration Guide β†’ to set up your JSON schemas correctly.


:two: :brain: Format Your TextViews with Style

Use ThMLT's format syntax to apply translation, font, and color in one go β€” directly within a text string.

[tag1,tag2,tag3]Visible Fallback Text

:white_check_mark: Example

[name,regular,label]Welcome Back!
Tag Purpose
name :abc: Translation key (from your translations JSON)
regular :capital_abcd: Font tag (matches shortFontTag in your Fonts JSON)
label :art: Semantic color key (from your Themes JSON's Semantic section)
Welcome Back! :identification_card: Visible fallback text if translation fails or # is used

:control_knobs: Partial Formatting Control with #

You can skip specific formatting layers by using # in any of the tag slots inside your [tag1,tag2,tag3] syntax.

[#,#,#]Text

Each # tells ThMLT to ignore that particular formatting layer:

Tag Position Meaning Example Result
1st (#) Skip Translation [#,bold,label]Hello Won’t translate; applies font & color. Applies fallback text
2nd (#) Skip Font [greeting,#,label]Hi Uses translation & color, skips font
3rd (#) Skip Color [greeting,bold,#]Hi Applies translation & font, no color

:white_check_mark: [#,regular,label]Welcome Back!
Skips translation β†’ keeps visible text β†’ applies font + color.

This gives you fine-grained control over how text is styled β€” even dynamically.


:three: :toolbox: Apply Formatting Block

Use the ApplyFormatting block to automatically scan all TextViews inside an Arrangement and apply formatting wherever the syntax is detected.

ApplyFormattingBlock

:round_pushpin: How it works:

  • Loops through all text components
  • Detects text components that starts with [tag1,tag2,tag3] patterns
  • Applies font, color, and translation instantly

:rotating_light: Important Notice

Version 3.0.0 introduces significant breaking changes. Please follow this guide carefully to avoid project breaking issues.

Use chrome extension

:rocket: Features

  • :rocket: Streamlined Project Control: Create, manage, and review projects effortlessly
  • :art: Intelligent Color Management: Define primitives, map semantics, and switch theme modes to ensure consistent, flexible design
  • :outbox_tray: Easy JSON Export: Share project data with a single click
  • :memo: Text Formatter: Edit texts directly from AI2 Builder
  • :bar_chart: Project Management: Import/export JSON data and manage multiple projects

Video Tutorial

v1

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

v2

Blocks Added :new:

Bug Fixes :zap:

  • Formatting not working in apk. It's fixed now
v2.1

AIX :
com.hridoy.thmlt.aix (10.3 KB)

AIA : ThMLT_V2_1.aia (269.3 KB)

v3.0.0 Latest :new:

AIX: com.hridoy.thmlt.aix (26.7 KB)
AIA: ThMLT_3_0_0.aia (317.4 KB)

Open Source

Chrome Extension source

8 Likes

Update - V2 :fire:

Blocks Added :new:

Bug Fixes :zap:

  • Formatting not working in apk. It's fixed now
1 Like

Hello!

I would like to use this extension and have a question about the json file.

Can I upload my json file into my project and use it from there with the call ThMLT1.Initialize block at translation files socket?

--
Best, PΓ‘l

For now it only takes json string as a parameter. JSON file support will come in v3. And v3 will have breaking changes.

And to manage colors easily im developing a chrome extension that will visualize colors and themes like figma.

1 Like

ThMLT Extension v3.0.0 Release Announcement

:rocket: ThMLT Extension v3.0.0 is here!

Big changes, better performance, and cleaner code.

:sparkles: What’s new?

  • Simplified initialization
  • Smarter translation blocks
  • Advanced color theming (primitive, semantic, and theme-aware)
  • Property-based language management
  • Improved formatting methods

:warning: Heads up: This is a breaking update. Follow the upgrade guide carefully to avoid issues.

Get started with the beta, update your blocks, test thoroughly, then switch to the final release.

Happy coding!
β€” Hridoy

1 Like