Univention Bugzilla – Attachment 7842 Details for
Bug 41223
Improve translation process
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Implemented both testcases as proposed. All issues from comments were adressed.
WIP_2016-07-27.patch (text/plain), 2.83 KB, created by
Eduard Mai
on 2016-07-27 18:30 CEST
(
hide
)
Description:
Implemented both testcases as proposed. All issues from comments were adressed.
Filename:
MIME Type:
Creator:
Eduard Mai
Created:
2016-07-27 18:30 CEST
Size:
2.83 KB
patch
obsolete
>diff --git a/packaging/univention-ucs-translation-template/test0.py b/packaging/univention-ucs-translation-template/test0.py >index 4f63745..a80c40c 100755 >--- a/packaging/univention-ucs-translation-template/test0.py >+++ b/packaging/univention-ucs-translation-template/test0.py >@@ -1,4 +1,5 @@ > #!/usr/bin/env python >+from distutils.file_util import copy_file > from hashlib import md5 > import logging > import os >@@ -45,7 +46,7 @@ def _change_entry_in_source_file(module_path, po_entry): > line = line.replace(po_entry.msgid, 'TEST! {}'.format(po_entry.msgid)) > changed_js.write(line) > >- >+SVN = 'SVN_TEST0' > TRANSLATION_PKG_NAME = 'univention-ucs-translation-XX' > # TODO: get latest public branch > if __name__ == '__main__': >@@ -57,23 +58,28 @@ if __name__ == '__main__': > pass > > try: >- tools.call('svn', 'checkout', 'http://forge.univention.org/svn/dev/branches/ucs-4.1/ucs-4.1-1/management/univention-management-console-module-passwordchange/', 'svn_repo/management/univention-management-console-module-passwordchange') >- tools.call('univention-ucs-translation-build-package', '--source=svn_repo', '--languagecode=XX', '--locale=fr_FR.UTF-8:UTF-8', '--languagename=TEST0') >+ tools.call('svn', 'checkout', 'http://forge.univention.org/svn/dev/branches/ucs-4.1/ucs-4.1-1', SVN) >+ tools.call('univention-ucs-translation-build-package', '--source={}'.format(SVN), '--languagecode=XX', '--locale=fr_FR.UTF-8:UTF-8', '--languagename=TEST0') > tools.call('univention-ucs-translation-fakemessage', TRANSLATION_PKG_NAME) > except InvalidCommandError: > print('Error: Tried to launch invalid command. Exiting.') > sys.exit(1) > > # Choose js files to manipulate >- js_po_files = tools.get_matching_file_paths(TRANSLATION_PKG_NAME, '*umc*js*.po') >- choosen_po_path = random.choice(js_po_files) >- choosen_po_pre_changes_path = '{}.pre-change'.format(choosen_po_path) >- shutil.copy(choosen_po_path, choosen_po_pre_changes_path) >- module_path = '/'.join(choosen_po_path.split('/')[2:4]) >- choosen_po = polib.pofile(choosen_po_path) >- random_entry = random.choice(choosen_po) >- >- _change_entry_in_source_file(module_path, random_entry) >+ changes = list() >+ for file_path_pattern in ('*umc*js*.po', '*umc*python*.po'): >+ po_paths = tools.get_matching_file_paths(TRANSLATION_PKG_NAME, '*umc*js*.po') >+ >+ # po_path, module_path, random_entry >+ for i in range(3): >+ random_po_path = po_paths.pop(random.choice(po_paths)) >+ # random_po_paths.append(random_po_path) >+ copy_file(random_po_path, '{}.pre_change'.format(random_po_path)) >+ module_path = '/'.join(random_po_path.split('/')[2:4]) >+ random_po = polib.pofile(random_po_path) >+ random_entry = random.choice(random_po) >+ _change_entry_in_source_file(module_path, random_entry) >+ > tools.call('univention-ucs-translation-merge', 'XX', 'svn_repo', TRANSLATION_PKG_NAME) > > if not _entry_is_fuzzy(random_entry, choosen_po_path):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 41223
:
7809
|
7832
|
7838
|
7842
|
7843