From 2178b6cc8470c75060bd972de142bf8fe826b411 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Tue, 9 Jan 2018 10:02:45 +0100 Subject: [PATCH] - Added some notes on preparing the code for i18n --- translation/README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/translation/README.md b/translation/README.md index 5eb8b8d..772b9ba 100644 --- a/translation/README.md +++ b/translation/README.md @@ -8,6 +8,39 @@ Please read the following CakePHP documentation about i18n & l10n: https://book. Please add a file à la: ja_JP.md (Japanese_Japan) or it_CH.md (Italian_Switzerland), in which you briefly describe what the current status is and what has been translated and which parts might be gotchas. +## Quirks + +Lines like this: + +``` +echo $this->Form->button('Submit', array('class' => 'btn btn-primary'));$ +``` + +Should be prepared as such: + +``` +echo $this->Form->button(__('Submit'), array('class' => 'btn btn-primary')); +``` + +Or another case: + +``` +echo $this->Form->input('sharing_group_id', array( + 'options' => array($sharingGroups), + 'label' => 'Sharing Group', +)); +``` + +To: + +``` +echo $this->Form->input('sharing_group_id', array( + 'options' => array($sharingGroups), + 'label' => __('Sharing Group'), +)); +``` + + ## Let us know! If you plan to do a translation or localization, please open a ticket on the issue system: https://github.com/MISP/MISP-book/issues