Skip to content

Commit 0cecc6a

Browse files
authored
Add Translation for error used data
En & indonesian only for now, please add your language
1 parent 6172341 commit 0cecc6a

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

messages/config.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
return [
4+
// string, required, root directory of all source files
5+
'sourcePath' => __DIR__ . DIRECTORY_SEPARATOR . '..',
6+
// string, required, root directory containing message translations.
7+
'messagePath' => __DIR__,
8+
// array, required, list of language codes that the extracted messages
9+
// should be translated to. For example, ['zh-CN', 'de'].
10+
'languages' => ['en', 'id-ID'],
11+
// string, the name of the function for translating messages.
12+
// Defaults to 'Yii::t'. This is used as a mark to find the messages to be
13+
// translated. You may use a string for single function name or an array for
14+
// multiple function names.
15+
'translator' => 'Yii::t',
16+
// boolean, whether to sort messages by keys when merging new messages
17+
// with the existing ones. Defaults to false, which means the new (untranslated)
18+
// messages will be separated from the old (translated) ones.
19+
'sort' => false,
20+
// boolean, whether the message file should be overwritten with the merged messages
21+
'overwrite' => true,
22+
// boolean, whether to remove messages that no longer appear in the source code.
23+
// Defaults to false, which means each of these messages will be enclosed with a pair of '@@' marks.
24+
'removeUnused' => false,
25+
// array, list of patterns that specify which files/directories should NOT be processed.
26+
// If empty or not set, all files/directories will be processed.
27+
// A path matches a pattern if it contains the pattern string at its end. For example,
28+
// '/a/b' will match all files and directories ending with '/a/b';
29+
// the '*.svn' will match all files and directories whose name ends with '.svn'.
30+
// and the '.svn' will match all files and directories named exactly '.svn'.
31+
// Note, the '/' characters in a pattern matches both '/' and '\'.
32+
// See helpers/FileHelper::findFiles() description for more details on pattern matching rules.
33+
'only' => ['*.php'],
34+
// array, list of patterns that specify which files (not directories) should be processed.
35+
// If empty or not set, all files will be processed.
36+
// Please refer to "except" for details about the patterns.
37+
// If a file/directory matches both a pattern in "only" and "except", it will NOT be processed.
38+
'except' => [
39+
'.svn',
40+
'.git',
41+
'.gitignore',
42+
'.gitkeep',
43+
'.hgignore',
44+
'.hgkeep',
45+
'/messages',
46+
],
47+
// Generated file format. Can be either "php", "po" or "db".
48+
'format' => 'php',
49+
// When format is "db", you may specify the following two options
50+
//'db' => 'db',
51+
//'sourceMessageTable' => '{{%source_message}}',
52+
];

messages/en/mtrelt.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Message translations.
4+
*
5+
* This file is automatically generated by 'yii message/extract' command.
6+
* It contains the localizable messages extracted from source code.
7+
* You may modify this file by translating the extracted messages.
8+
*
9+
* Each array element represents the translation (value) of a message (key).
10+
* If the value is empty, the message is considered as not translated.
11+
* Messages that no longer need translation will have their translations
12+
* enclosed between a pair of '@@' marks.
13+
*
14+
* Message string can be used with plural forms format. Check i18n section
15+
* of the guide for details.
16+
*
17+
* NOTE: this file must be saved in UTF-8 encoding.
18+
*/
19+
return [
20+
'Data can\'t be deleted because it\'s still used by another data.' => 'Data can\'t be deleted because it\'s still used by another data.',
21+
];

messages/id-ID/mtrelt.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Message translations.
4+
*
5+
* This file is automatically generated by 'yii message/extract' command.
6+
* It contains the localizable messages extracted from source code.
7+
* You may modify this file by translating the extracted messages.
8+
*
9+
* Each array element represents the translation (value) of a message (key).
10+
* If the value is empty, the message is considered as not translated.
11+
* Messages that no longer need translation will have their translations
12+
* enclosed between a pair of '@@' marks.
13+
*
14+
* Message string can be used with plural forms format. Check i18n section
15+
* of the guide for details.
16+
*
17+
* NOTE: this file must be saved in UTF-8 encoding.
18+
*/
19+
return [
20+
'Data can\'t be deleted because it\'s still used by another data.' => 'Data tidak bisa dihapus karena masih digunakan oleh data lain.',
21+
];

0 commit comments

Comments
 (0)