Commit graph

20 commits

Author SHA1 Message Date
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Ankush Menat
da872a0edf feat: modified parser for frappe JS translate syntax 2022-08-04 15:33:02 +05:30
Ankush Menat
cd53466b6a feat: JS extractor and custom JS parser 2022-08-04 15:19:56 +05:30
Ankush Menat
1425842ef0 refactor: extract python translations using babel
RIP my cool handwritten AST code :'(

Few things to note:

1. Publicly documented APIs, they don't support capturing kwargs.
2. We can't use documented "lower level" APIs, we need to go _even lower_.
2022-08-04 15:19:55 +05:30
Ankush Menat
ea836a824a feat: use AST to extract translation sources 2022-08-04 15:19:55 +05:30
Ankush Menat
d90d6536ef perf: dont rebuild same translation dict 2022-05-22 22:54:23 +05:30
Ankush Menat
26b54221ea test: verify ALL translation file syntax 2022-05-13 16:12:40 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Ankush Menat
29ca4d7aaa feat: allow splitting _() function call on multiple lines 2022-03-26 16:18:35 +05:30
Ankush Menat
92c563d193 test: refactor translation extraction test 2022-03-26 16:18:35 +05:30
Suraj Shetty
9006f92296
test: Fix flaky test of language selection (#15373) 2021-12-20 19:37:52 +05:30
Suraj Shetty
4441eb7d90 test: Fix test_request_language_resolution_with_cookie 2021-09-08 11:45:15 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
29706e5d14 test: Update tests as per new lang resolution 2021-07-30 19:50:38 +05:30
Gavin D'souza
a6537ce987 test: Invoke get_language directly instead of via HTTPRequest 2021-07-15 15:38:36 +05:30
Gavin D'souza
421220a872 test: Added tests for frappe.translate.get_language 2021-07-15 01:04:04 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Rushabh Mehta
864956e30f fix(minor): homepage for frappe and tests 2021-01-01 18:03:06 +05:30
Suraj Shetty
981da526f9 fix: Contextual translation key generation 2020-05-04 22:27:06 +05:30
Suraj Shetty
ba162425ac test: Add translation extraction test 2020-05-03 18:41:19 +05:30