Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: multilingual interface for TFT

  1. #1
    Member
    Join Date
    Oct 2017
    Location
    Ukraine
    Posts
    58

    multilingual interface for TFT

    Hello!
    I am using T3.6 and ILI9341 display (SPI). my project must have a multilingual interface: English, Russian and Ukrainian.
    Can you please tell me how can I modify the Arduino environment and my sketch to display multiple languages ​​at the same time?
    Code:
    #include "SPI.h"
    #include "LoRa.h"
    #include "ILI9341_t3.h"
    // For the Adafruit shield, these are the default.
    #define TFT_DC  9
    #define TFT_CS 10
    // Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
    ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC);
    
    void setup() 
    {
      tft.begin();
      tft.setRotation(2);
      tft.fillScreen(ILI9341_BLACK);
      tft.setTextColor(ILI9341_YELLOW);
      tft.setCursor(0, 0);
      tft.setTextSize(2);
    
      tft.println("Hello Word");
      tft.println("Здравствуй Мир");// Rusian text
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
    }

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,366
    A common technique is to use code numbers for text strings, and a dynamic mapping occurs when printing strings to
    the screen, dependent on the selected language. I'd suggest googling "I18N"

  3. #3
    Member
    Join Date
    Oct 2017
    Location
    Ukraine
    Posts
    58
    I understand that in my case different encodings are used. But your recommendation does not help me or I do not know how to apply it.

  4. #4
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,366
    For instance searching for I18N should find things like gettext: https://en.wikipedia.org/wiki/Gettext

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •