Feature ini adapter translate #2706

Closed
wants to merge 11 commits into
from

Conversation

Projects
None yet
4 participants
Contributor

blanchonvincent commented Oct 8, 2012

Feature ini adapter translate

blanchonvincent added some commits Oct 8, 2012

Fix french translation
Fix french translation
Other fix french translation
Other fix french translation
Add INI loader for translator
Add INI loader for translator
Add tests for INI loader translator
Add tests for INI loader translator
Add new syntax more user friendly
Add new syntax more user friendly
Add tests for new syntax
Add tests for new syntax
Fix CS PSR2
Fix CS PSR2
revert zend messages, bad manipulation
revert zend messages, bad manipulation
library/Zend/I18n/Translator/Loader/Ini.php
+ $textDomain = new TextDomain($messages);
+
+ if (array_key_exists('plural', $messagesNamespaced)) {
+ if (isset($messagesNamespaced['plural']['plural_forms'])) {
@weierophinney

weierophinney Oct 10, 2012

Owner

Combine these into a single conditional using '&&'.

library/Zend/I18n/Translator/Loader/Ini.php
+ $messages[$message['message']] = $message['translation'];
+ } else {
+ $messages[array_shift($message)] = array_shift($message);
+ }
@weierophinney

weierophinney Oct 10, 2012

Owner

Rewrite the above as:

if (isset($message['message'] && isset($message['translation'])) {
    $messages[$message['message'] = $message['translation'];
    continue;
}
$messages[array_shift($message)] = array_shift($message);

@ghost ghost assigned DASPRiD Oct 10, 2012

Owner

weierophinney commented Oct 10, 2012

Looks clean enough -- have you had any feedback on the mailing list or @DASPRiD ?

Contributor

blanchonvincent commented Oct 10, 2012

Code change is done. Thx.
No, i had no feedback from the mailing list.

blanchonvincent added some commits Oct 10, 2012

Code refactory, more readable
Code refactory, more readable
Fix code condition
Fix code condition
tests/ZendTest/I18n/Translator/_files/translation_en_simple_syntax.ini
+idenfitier6[] = "Küchen Möbel (en)"
+
+idenfitier7[] = "Küchen Möbel"
+idenfitier7[] = "Cooking furniture (en)"
@ThomasCantonnet

ThomasCantonnet Nov 14, 2012

Contributor

Dunno if you wanna correct everything, but you wrote identifier wrong everywhere (idenfitier) :p

@blanchonvincent

blanchonvincent Nov 14, 2012

Contributor

Oops, i will change this :)

@blanchonvincent

blanchonvincent Nov 14, 2012

Contributor

It's fixed, thank you.

weierophinney added a commit that referenced this pull request Dec 10, 2012

[#2706] CS cleanup
- whitespace around conditionals
- remove commented code
- EOF markers

@ghost ghost assigned weierophinney Dec 10, 2012

Owner

weierophinney commented Dec 10, 2012

@blanchonvincent If you haven't yet, please submit some docs on using the new adapter. :)

weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015

[zendframework/zendframework#2706] CS cleanup
- whitespace around conditionals
- remove commented code
- EOF markers

weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-i18n-resources that referenced this pull request May 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment