- Bash Cookbook
- Ron Brash Ganesh Naik
- 315字
- 2021-07-23 19:17:38
Readying your script for different languages with internationalization
Great, so you have this awesome script, but it's written in standard English and you would like to target those nice people who speak other languages. In some countries like Canada, they (we) have two official languages: English and French. Sometimes, the dual-language component is enforced with legislature and localized language laws.
To get around this, let's imagine a scenario where you are an individual who has written a script that prints out specific strings, but in English first. He/she wishes to have all of the strings inside of variables so that they can be swapped in and out dynamically using system language variables. Here are the basics:
- Create a shell script that utilizes gettext and sets the appropriate variables
- Build a po file that contains the necessary language definitions
- Install your output language localization file for your script
- Run your script with a language that's different than the one you originally use (by setting the LANG variable)
Before getting started, though, there are two terms that need to be discussed: internationalization (i18n) and localization (L10n). Internationalization is a process that enables translation and localisation/adaptation for a specific script or program, and localization refers to the process of having adapted the program/application for a specific culture.
For example, in English, there are several dialects. In the USA, a product of a process or leftover can be called an artifact, but in Canadian English, it may be called an artefact. It could go unnoticed (or ignored), but the program could automatically adapt with specific localization.
- HornetQ Messaging Developer’s Guide
- OpenShift開發指南(原書第2版)
- DevOps Automation Cookbook
- Microsoft Azure Storage Essentials
- 機器學習微積分一本通(Python版)
- Android移動應用開發項目教程
- SEO教程:搜索引擎優化入門與進階(第3版)
- Get Your Hands Dirty on Clean Architecture
- Python 快速入門(第3版)
- IBM RUP參考與認證指南
- ArcPy and ArcGIS(Second Edition)
- 軟件測試項目實戰之功能測試篇
- Python Natural Language Processing
- MATLAB程序設計及應用
- 數據結構和算法(Python和C++語言描述)