Skip to content

Instantly share code, notes, and snippets.

@alroniks
Created January 16, 2014 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alroniks/8452788 to your computer and use it in GitHub Desktop.
Save alroniks/8452788 to your computer and use it in GitHub Desktop.
Script for add all files of modx lexicons to trasifex
<?php
$cmdSource = 'tx set --source -r modx-revolution.core-{:slug} -l {:lang} core/lexicon/{:lang}/{:file} -t PHP_ALT_ARRAY';
$cmdTransl = 'tx set -r modx-revolution.core-{:slug} -l {:lang} core/lexicon/{:lang}/{:file} -t PHP_ALT_ARRAY';
$search = ['{:slug}', '{:file}', '{:lang}'];
$langs = [
'ru',
'de',
'cs',
'es',
'et',
'fr',
'it',
'ja',
'nl',
'pl',
'pt-br',
'sv',
'th'
];
$files = [
'about.inc.php',
'access.inc.php',
'action.inc.php',
'category.inc.php',
'chunk.inc.php',
'configcheck.inc.php',
'content_type.inc.php',
'context.inc.php',
'dashboard.inc.php',
'dashboards.inc.php',
'default.inc.php',
'element.inc.php',
'export.inc.php',
'file.inc.php',
'filters.inc.php',
'formcustomization.inc.php',
'import.inc.php',
'lexicon.inc.php',
'login.inc.php',
'mail.inc.php',
'manager_log.inc.php',
'menu.inc.php',
'messages.inc.php',
'namespace.inc.php',
'package_builder.inc.php',
'permissions.inc.php',
'plugin.inc.php',
'policy.inc.php',
'propertyset.inc.php',
'resource.inc.php',
'rest.inc.php',
'setting.inc.php',
'snippet.inc.php',
'source.inc.php',
'system_events.inc.php',
'system_info.inc.php',
'template.inc.php',
'topmenu.inc.php',
'tv.inc.php',
'tv_input_types.inc.php',
'tv_widget.inc.php',
'user.inc.php',
'welcome.inc.php',
'workspace.inc.php'
];
foreach ($files as $file) {
echo exec(str_replace($search, [str_replace('.inc.php', '', $file), $file, 'en'], $cmdSource)), "\n";
foreach ($langs as $lang) {
echo exec(str_replace($search, [str_replace('.inc.php', '', $file), $file, $lang], $cmdTransl)), "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment