Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate Adapter for multi-column csv #890

Merged
merged 19 commits into from
Mar 7, 2019

Conversation

challet
Copy link
Contributor

@challet challet commented Mar 3, 2019

Hello!

  • Type: new feature

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the Contributing Guidelines?
  • I have checked that another pull request for this purpose does not exist.
  • I wrote some tests for this PR.

Small description of change: adding a multi-column csv adapter for the translations.

  • CSV example (blank spaces added for readability):
#ignored;     en_US;  fr_FR;   es_ES
label_street; street; rue;     calle
label_car;    car;    voiture; coche
label_home;   home;   maison;  casa
  • PHP example :
// the constructor is inherited from Phalcon\Translate\Adapter\Csv
$titles_translater = new Phalcon\Translate\Adapter\MultiCsv([
    'content' => "{$config->langDir}/titles.csv"
]);
$titles_translater->setLocale('es_ES');
echo $titles_translater->query('label_home'); // string 'casa'

It might remain a check to be done about the ArrayAccess interface (inherited from Phalcon\Translate\Adapter\Csv)

@challet
Copy link
Contributor Author

challet commented Mar 3, 2019

Looks like the last commit (upgrading codeception) fixed this error but broke something else. Help please.

@sergeyklay
Copy link
Contributor

@challet Looks solid. Could you fix tests?

@challet
Copy link
Contributor Author

challet commented Mar 6, 2019

@sergeyklay finally done.

@sergeyklay sergeyklay merged commit f8e2be2 into phalcon:3.4.x Mar 7, 2019
@sergeyklay
Copy link
Contributor

Thank you

@challet
Copy link
Contributor Author

challet commented Mar 7, 2019

You're welcome

sergeyklay pushed a commit that referenced this pull request Jul 27, 2019
* #875: Swiftmailer and Twig are no longer required

Moved Swiftmailer and Twig to the Composer "suggest"

* Add new validator: ArrayInclusionIn

* Fix unit test

* Fix unit test - last test method

* Support for the TIMESTAMPDIFF

* Add options to ReCaptcha Validator to make it work with v3.

* Fixed PHPCS issues

* fix(oracle): Added missing interface method sharedLock

* Moved opening brace to newline as suggested

Co-Authored-By: lubber-de <[email protected]>

* Translate Adapter for multi-column csv (#890)

* [Translate] add an intl MessageFormatter interpolator (#892)

* Tidied up READMEs.

* Applied PSR2 to tests.

* Code standards.

* Tidied up Annotations.

* Tidied up codebase.
ruudboon pushed a commit to ruudboon/incubator that referenced this pull request Aug 30, 2019
ruudboon added a commit to ruudboon/incubator that referenced this pull request Aug 30, 2019
* phalcon#875: Swiftmailer and Twig are no longer required

Moved Swiftmailer and Twig to the Composer "suggest"

* Add new validator: ArrayInclusionIn

* Fix unit test

* Fix unit test - last test method

* Support for the TIMESTAMPDIFF

* Add options to ReCaptcha Validator to make it work with v3.

* Fixed PHPCS issues

* fix(oracle): Added missing interface method sharedLock

* Moved opening brace to newline as suggested

Co-Authored-By: lubber-de <[email protected]>

* Translate Adapter for multi-column csv (phalcon#890)

* [Translate] add an intl MessageFormatter interpolator (phalcon#892)

* Tidied up READMEs.

* Applied PSR2 to tests.

* Code standards.

* Tidied up Annotations.

* Tidied up codebase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants