What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi Everyone! I am trying to package a module properly so it can be easily reused. The problem I’m fa
Hi Everyone! I am trying to package a module properly so it can be easily reused. The problem I’m facing now is with packaging default translations for the strings.
I can’t see an obvious place to store them.
If I create a mymodule.stringname glossary reference, how should I attach the translations to it?
Should I just create a csv and point out in the instructions that translations should be added to the importer?
Comments
-
If you build packages and use ur own namespace, the people who uses ur package has to configure the stack for this purpose. The normal way adding translations is to add them into "data/translation/Zed". So spryker itself scan ootb with
APPLICATION_VENDOR_DIR . '/spryker/*/data/translation/Zed/[a-z][a-z]_[A-Z][A-Z].csv'
For your doing you have to extend the TranslatorConfig on pyz with your own path/pattern and provide the information via instructions.
So for the fond-of* vendor packages the required configuration is
<?php namespace Pyz\Zed\Translator; use Spryker\Zed\Translator\TranslatorConfig as SprykerTranslatorConfig; class TranslatorConfig extends SprykerTranslatorConfig { /** * @return array<string> */ public function getTranslationFilePathPatterns(): array { $pathPatterns = parent::getTranslationFilePathPatterns(); $pathPatterns[] = APPLICATION_VENDOR_DIR . '/fond-of-spryker/*/data/translation/Zed/[a-z][a-z]_[A-Z][A-Z].csv'; $pathPatterns[] = APPLICATION_VENDOR_DIR . '/fond-of-oryx/*/data/translation/Zed/[a-z][a-z]_[A-Z][A-Z].csv'; $pathPatterns[] = APPLICATION_VENDOR_DIR . '/fond-of-oryx/fond-of-oryx/bundles/*/data/translation/Zed/[a-z][a-z]_[A-Z][A-Z].csv'; return $pathPatterns; } }
0 -
thanks @UK7KBE2JW, very helpful. Exactly what I was looking for 🙂
0 -
ur welcome
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 69 Spryker News
- 894 Developer Corner
- 757 Spryker Development
- 83 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 22 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random