GithubHelp home page GithubHelp logo

athiffau / langtool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omarreis/langtool

0.0 1.0 0.0 721 KB

LangTool is an alternative component editor for TLang component ( Delphi Firemonkey )

Pascal 100.00%

langtool's Introduction

LangTool

LangTool

LangTool is a language editor for Delphi Firemonkey, to help with app localization. It manages LNG ( language files ) to be used with component TLang. This app offers some features not found in the original TLang IDE Language Designer.

LangTool can installed on the Delphi IDE as a design time package or run as a desktop app. The package contains no new components, only an alternative TLang Component Editor.

Tested on Windows 10 (Delphi 10.3.3)

What's inside LNG files ?

  • List of Original texts (TStrings)
  • List of translation Resources. Each resource (language) has:
    • lang code: two letter ISO language code ( use capital letters )
    • Strings: list of text=translation lines for the language

Languages can be loaded from a file or from form resources. The last loaded language goes into global var Lang:TStringList

Translate() function does translations at run time.

LangTool features :

  • Load/Save *.LNG files
  • Add/delete languages
  • Edit all languages in the same grid (uses a TStringGrid, edit strings in place)
  • Copy original list of texts to clipboard (ex: to use with Google Translate)
  • Paste list of strings from clipboard (input translation results). Before pasting a list of strings from clipboard remember to place the cursor in the desired cell Place cursor on the top of the column to paste a whole new language ( list of strings )
  • Drag columns ( change language order, not that this matters.. )

Note that automatic translation services a lot of times translate words out of context. Have a translator - or at least a native speaker - review your app translations.

LangTool installation

LangTool installs on the IDE as a design time package. Compile dclLangTool.dpk and install it.

Right-click a TLang component on a Form. Now you have 2 options: TLang menu

  • Show LangTool Editor.. <--- LangTool
  • Show IDE Lang Designer.. <--- Original component editor

Original editor can be used to import texts from form, export templates and LNG files. The original IDE editor, however, cannot delete languages, or edit all languages in the same grid, or copy-paste languages to-from translation services. For that you now have LangTool :)

TODO: Localize LangTool !!!! :)

But wait...There is more!

You may want to localize Delphi default dialog texts ( Yes, No etc). This is not done by TLang. To do that copy FMX.Dialogs.pas to project directory and change it as described in this stackoverflow answer (the one by omarreis)

https://github.com/omarreis/LangTool/blob/master/fixDialogs.md

https://stackoverflow.com/questions/39750219/how-to-change-at-runtime-the-value-of-smsgdlgyes-smsgdlgno-etc/61643607#61643607

LangTool screen screenshot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.