Commit graph

41 commits

Author SHA1 Message Date
barredterra
b23b0633e5 fix: create new pot file instead of adding to existing one 2024-01-12 01:55:14 +01:00
barredterra
547a6107ce fix: improve translatable string description 2024-01-11 19:32:40 +01:00
Ankush Menat
1e83b2e848 fix: disable line wrapping for PO files
This is a relic from old days where text had to be formatted <80 chars so
terminals can read them. We have massive screens now.
2024-01-11 18:51:53 +05:30
Ankush Menat
98b62e8220 fix: add _lt to extractors 2024-01-10 21:47:55 +05:30
Ankush Menat
1f83fd8847 fix: skip if file is not found 2024-01-10 20:47:58 +05:30
Ankush Menat
f246f37762 fix: language variants support 2024-01-10 18:27:57 +05:30
Ankush Menat
e893312f37 perf: parallelize MO compilation
This operation is CPU heavy and has little to no Frappe code
involvement. So we can use a processpool of 4 to reduce time taken for
compilation by 4x.
2024-01-10 17:21:19 +05:30
Ankush Menat
9482126b93 perf: Skip rebuilding MO files where PO file is not updated 2024-01-10 17:04:34 +05:30
Ankush Menat
5d8208ccf4 feat: Build MO files with bench build
Translation assets are also... assets, so grouping them with `bench build`.

We can do some special function but that will likely require updating
bench for everyone. Not so ideal.

Also renamed `compile` function as it is a builtin in python.
2024-01-10 16:41:04 +05:30
barredterra
7e60d4d6d3 test: gettext utils 2023-12-30 03:37:33 +01:00
barredterra
231d1c2631 refactor: variable names 2023-12-30 03:01:55 +01:00
barredterra
5601a86587 fix: variable name conflict 2023-12-30 02:09:32 +01:00
barredterra
ef993511f0 fix: avoid writing empty .mo files 2023-12-30 01:59:55 +01:00
barredterra
45907318de fix: handle missing locale directory 2023-12-30 01:59:18 +01:00
barredterra
a53e819022 fix: move extract_javascript to extractors folder and use it
instead of babels js extractor
2023-12-28 17:00:46 +01:00
barredterra
7d4bdbebb9 feat: apps can provide custom message extractors
- custom extractors take precedence
- default extractors are used as a fallback
2023-12-27 01:44:48 +01:00
barredterra
e1140a22b8 fix: don't presume english as source language
Note: If we DO want this, it should happen at a higher level.
2023-12-26 23:18:07 +01:00
barredterra
483fa15c8f fix: clear translation cache
- Cache was not getting cleared, since it's user-specific
- Remove unused implementation from gettext
2023-12-26 23:17:31 +01:00
barredterra
3a76fb2253 feat: support CSV and gettext at the same time 2023-12-26 19:13:10 +01:00
barredterra
a3feb08100 fix: integrate upstream changes 2023-11-06 20:40:37 +01:00
barredterra
8a0f921d78 refactor: reuse existing get_user_translations 2023-11-06 20:40:22 +01:00
barredterra
5839963475 fix: integrate upstream changes 2023-11-06 20:39:09 +01:00
barredterra
f00b510828 fix: prefer more specific extractors 2023-11-06 20:37:11 +01:00
barredterra
e16f1632a7 chore: remove unused method 2023-11-06 19:49:47 +01:00
barredterra
415834809f feat: add extractor for Module Onboarding 2023-10-29 16:27:34 +01:00
barredterra
4a54fafa19 feat: add extractor for Onboarding Step 2023-10-29 16:19:52 +01:00
barredterra
39e12ba14c fix: get_translations_from_apps
- Only consider installed apps
- Handle context correctly
2023-10-29 15:18:03 +01:00
barredterra
5c6ad3dfe2 fix: rename cache keys to avoid conflict 2023-10-29 15:09:21 +01:00
barredterra
a1e052bbb5 chore: use existing get_dict_from_hooks 2023-10-29 15:04:21 +01:00
barredterra
b280f45bff chore: remove unused methods
These are much slower than the other approach (results are not cached).
Also, they are lacking a fallback mechanism for missing context.
2023-10-29 14:43:27 +01:00
barredterra
fab8ae8fd6 refactor: folder structure
- put .po files into [app]/locale/[lang].po
- put .mo files into sites/assets/locale/[lang]/LC_MESSAGES/[app].mo

The latter structure is mandated by the gettext library.
2023-10-29 01:25:54 +02:00
barredterra
3efe080844 fix: navbar extractor 2023-10-15 21:02:50 +02:00
barredterra
a891feb440 feat: gettext utils 2023-10-15 20:28:13 +02:00
barredterra
4de07d0c88 docs: extractor README 2023-10-15 20:27:28 +02:00
barredterra
bd9bb6d0d6 feat: workspace extractor 2023-10-15 20:27:01 +02:00
barredterra
abcafafca9 feat: report extractor 2023-10-15 20:26:46 +02:00
barredterra
6b1e12e49b feat: navbar extractor 2023-10-15 20:26:32 +02:00
barredterra
30c8ffb600 feat: jinja2 extractor 2023-10-15 20:25:58 +02:00
barredterra
353a6c8d6e feat: doctype extractor 2023-10-15 20:25:44 +02:00
barredterra
1fd7e84f90 feat: javascript extractor 2023-10-15 20:25:14 +02:00
barredterra
6c4184afc2 feat: python extractor 2023-10-15 20:25:01 +02:00