Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tutorial:adm:personalize_localization [2018/12/28 13:31]
kotisovam [Script run]
tutorial:adm:personalize_localization [2022/11/28 14:27] (current)
kopro
Line 1: Line 1:
 ====== Personalize localization ====== ====== Personalize localization ======
 +
 +<WRAP center round info 60%>
 +
 +This tutorial may be obsole for newer version.
 +
 +</WRAP>\\
 If you want to personalize some of error, warning, info messages, labels, buttons, etc. you can use the simple shell script (for now, TODO is the script only for Linux systems). If you want to personalize some of error, warning, info messages, labels, buttons, etc. you can use the simple shell script (for now, TODO is the script only for Linux systems).
  
-Presently, you can download the script [[http://up.xyxy.cz/f.php?h=3mcRC8p0&d=1|here]]  (TODO script will be part of the product).+Presently, you can download the script (TODO script will be part of the product).
  
 Place the script into the built-in frontend (eq. czechidm-app/dist/). Place the script into the built-in frontend (eq. czechidm-app/dist/).
  
 As **pre-requisites** you must install [[https://stedolan.github.io/jq/|jq library]]. JQ is like sed for JSON data. For a debian system you can use: As **pre-requisites** you must install [[https://stedolan.github.io/jq/|jq library]]. JQ is like sed for JSON data. For a debian system you can use:
-  $ apt-get install jq+<code> 
 + 
 +$ apt-get install jq 
 + 
 +</code>
  
 Set up a script permission: Set up a script permission:
-  $ chmod +x localizationTransform.sh 
-   
-Create file ''override_localization.txt'' at same path as script. The list files of folder czechidm-app will be like: 
  
 +<code>
 +$ chmod +x localizationTransform.sh
 +
 +</code>
 +
 +Create file ''override_localization.txt'' at same path as script. The list files of folder czechidm-app will be like:
 <code> <code>
 build.sh build.sh
Line 27: Line 40:
 package.json package.json
 src src
 +
 </code> </code>
  
Line 32: Line 46:
  
 In file ''override_localization.txt'' is each line one override message. Structure: In file ''override_localization.txt'' is each line one override message. Structure:
 +<code>
 +<MODULE_ID>;<LOCALIZATION>;<LOCALIZATION_KEY>;<LOCALIZATION_MESSAGE>
  
-  <MODULE_ID>;<LOCALIZATION>;<LOCALIZATION_KEY>;<LOCALIZATION_MESSAGE>+</code>
  
   * **MODULE_ID**: id of module (core, acc, reg, pwdreset),   * **MODULE_ID**: id of module (core, acc, reg, pwdreset),
Line 39: Line 55:
   * **LOCALIZATION KEY**: key of override message,   * **LOCALIZATION KEY**: key of override message,
   * **LOCALIZATION MESSAGE**: new localization message   * **LOCALIZATION MESSAGE**: new localization message
 +Examples:
  
- 
-Examples: 
 <code> <code>
 core;en;app.name;New CzechIdM core;en;app.name;New CzechIdM
Line 49: Line 64:
 acc;cs;content.system.detail.header;New connected system acc;cs;content.system.detail.header;New connected system
 acc;en;content.system.detail.header;Nový napojený systém acc;en;content.system.detail.header;Nový napojený systém
 +
 </code> </code>
  
 ===== Script run ===== ===== Script run =====
-  $ ./lozalizationTransform.sh+ 
 +<code> 
 +$ ./lozalizationTransform.sh 
 + 
 +</code>
  
 On running the script, you get a message displaying the standard output. If some localization key will not be found though, you will receive an error message pointing out the reason for failure: On running the script, you get a message displaying the standard output. If some localization key will not be found though, you will receive an error message pointing out the reason for failure:
-  FAILED key: 'content.role.nonExisting' was not found.+ 
 +<code> 
 +FAILED key: 'content.role.nonExisting' was not found. 
 + 
 +</code>
  
 ===== Example output of script ===== ===== Example output of script =====
  
 <code> <code>
-➜  dist ./lozalizationTransform.sh  +➜  dist ./lozalizationTransform.sh 
-     ____              _       ___    _ __  __  +     ____              _       ___    _ __  __ 
-    / ___|_______  ___| |__   |_ _|__| |  \/  | +    / ___|_______  ___|   |__   |_ _|__|   |  \/  | 
-   | |   |_  / _ \/ __| '_ \   | |/ _' | |\/| | +     |   |_  / _ \/ __| '_ \     |/ _' |   |\/|   
-   | |___ / /  __/ (__| | | |  | | (_| | |  | | +     |___ / /  __/ (__|   | |   |  |   | (_|   | |   | | 
-    \____/___\___|\___|_| |_| |___\__,_|_|  |_| +    \____/___\___|\___|_|   |_|   |___\__,_|_|   |_| 
- ___  _____   __          _      _                + ___  _____   __          _      _   _ 
-| _ )/ __\ \ / /  ___ ___| |_  _| |_(_)___ _ _  ___ +| _ )/ __\ \ / /  ___ ___|   |_  _|   |_(_)___ _ _  ___ 
-| _ \ (__ \ V /  (_-</ _ \ | || |  _| / _ \ ' \(_-< +| _ \ (__ \ V /  (_-</ _ \ |   ||   |  _| / _ \ ' \(_-<|___/\___| \_/   /__/\___/_|\_,_|\__|_\___/_||_/__/
-|___/\___| \_/   /__/\___/_|\_,_|\__|_\___/_||_/__/+
 Script for transfrom lozalization message from build FE project Script for transfrom lozalization message from build FE project
  
Line 83: Line 106:
  
 </code> </code>
 +
 +
  • by kotisovam