diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:58:52 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:58:52 -0300 |
commit | 2d9b20157957a55bd83875775085ed31c9062577 (patch) | |
tree | f051d6d805a3448ea243379a2457be8d67dcfa5f /actions/merge.php | |
download | elgg-2d9b20157957a55bd83875775085ed31c9062577.tar.gz elgg-2d9b20157957a55bd83875775085ed31c9062577.tar.bz2 |
Squashed 'mod/translation_editor/' content from commit 9d86955
git-subtree-dir: mod/translation_editor
git-subtree-split: 9d86955e6d8b6807578f5a9da0346ac1a146881c
Diffstat (limited to 'actions/merge.php')
-rw-r--r-- | actions/merge.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/actions/merge.php b/actions/merge.php new file mode 100644 index 000000000..db1e75276 --- /dev/null +++ b/actions/merge.php @@ -0,0 +1,29 @@ +<?php + gatekeeper(); + + $current_language = get_input("current_language"); + $plugin = get_input("plugin"); + + if(translation_editor_is_translation_editor()){ + + // We'll be outputting a CSV + header("Content-Type: text/plain"); + + // It will be called $lang.php + header('Content-Disposition: attachment; filename="' . $current_language . '.php"'); + + $translation = translation_editor_get_plugin($current_language, $plugin); + $translation = $translation['current_language']; + + echo "<?php" . PHP_EOL; + echo '$language = '; + echo var_export($translation); + echo ';' . PHP_EOL; + echo 'add_translation("' . $current_language . '", $language);' . PHP_EOL; + + exit(); + + } else { + register_error(elgg_echo("transation_editor:action:translate:error:not_authorized")); + forward(REFERER); + } |