Comments (2)
I cannot upload patch here, but I've already created command for myself
diff --git a/src/Commands/core/LocaleCommands.php b/src/Commands/core/LocaleCommands.php
index fea828a6e..903b14519 100644
--- a/src/Commands/core/LocaleCommands.php
+++ b/src/Commands/core/LocaleCommands.php
@@ -27,6 +27,7 @@ final class LocaleCommands extends DrushCommands
const UPDATE = 'locale:update';
const EXPORT = 'locale:export';
const IMPORT = 'locale:import';
+ const EXPORT_ALL = 'locale:export-all';
const IMPORT_ALL = 'locale:import-all';
protected function getLanguageManager(): LanguageManagerInterface
@@ -284,6 +285,30 @@ final class LocaleCommands extends DrushCommands
drush_backend_batch_process();
}
+ /**
+ * Exports multiple translation files into the defined directory.
+ *
+ * @throws \Exception
+ */
+ #[CLI\Command(name: self::EXPORT_ALL, aliases: ['locale-export-all', 'locale:export:all'])]
+ #[CLI\Argument(name: 'directory', description: 'Export directory for translation files.')]
+ #[CLI\Option(name: 'types', description: 'A comma separated list of string types to include, defaults to all types. Recognized values: <info>not-customized</info>, <info>customized</info>, </info>not-translated<info>')]
+ #[CLI\ValidateModulesEnabled(modules: ['locale'])]
+ public function exportAll($directory, $options = ['types' => self::REQ])
+ {
+ if (!is_dir($directory)) {
+ throw new \Exception('The defined directory does not exist.');
+ }
+
+ $languages = $this->getLanguageManager()->getLanguages();
+ $poreader_options = $this->convertTypesToPoDbReaderOptions(StringUtils::csvToArray($options['types']));
+ foreach ($languages as $language) {
+ $langcode = $language->getId();
+ $this->writePoFile($directory . '/' . $langcode . '.po', $language, $poreader_options);
+ }
+
+ }
+
/**
* Converts input of translation type.
*
from drush.
Hi. We are in need of a new locale maintainer for Drush. Hopefully they will show up and evaluating this will be a nice first task for them.
from drush.
Related Issues (20)
- bash completion hangs/breaks on drush generate HOT 1
- Drush commands throw TypeError: ucfirst() when $databases array is empty HOT 2
- How drush database update works? HOT 2
- Drush commands for workspaces HOT 2
- Queue items don't have "item_id" if the queue is stored in Redis HOT 2
- PHP Fatal error: Trait "Drush\Commands\AutowireTrait" not found in DevelCommands.php HOT 4
- Add option to update site UUID on config import HOT 4
- drush queue:run referencing not existing hooks
- Add a command to generate batch service HOT 1
- Add support for symfony 7 in 13.x and minimum version of PHP 8.3
- Database update step for `drush deploy` behaves differently than `drush updb --no-cache-clear` HOT 2
- 'Generate generator' command is missing in Drush 12.5+ (present in 13)
- Stop supporting and testing the Windows OS HOT 1
- Environment variables ignored if the value provided in the configuration file HOT 2
- DrupalFinder drush replacement PR did not fully replaced it in Preflight HOT 3
- Fatal error on cron command help HOT 2
- Twig compile - provide searchpaths argument HOT 1
- Lexer.php/ParserAbstract.php errors when calling namespaced class in php-cli
- Severe error when `ddev start`
- Symlinks to directories outside project break archive dump.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drush.