Commit graph

82 commits

Author SHA1 Message Date
Raffael Meyer
163094c898
fix(gettext): extract template-literal translations with correct line numbers (#38063) 2026-03-16 18:52:04 +00:00
Exequiel Arona
06c8217c99
feat: add extractors for Workspace Sidebar and Desktop Icon (#37085)
* feat: add desktop icon extractor

* feat: add workspace sidebar extractor

* feat: add desktop icon extractor

* fix: resolve merge conflict in babel_extractors.csv

* docs: fix typo in docstring

---------

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2026-02-16 15:12:01 +00:00
Raffael Meyer
0df57b6133
feat(translations): add hook to exclude translatable strings from dependencies (#34544) 2025-11-10 12:50:21 +01:00
Raffael Meyer
5eadd23b11
feat: extract translatable strings from standard web forms (#34237)
* feat: extract translatable strings from standard web forms

* fix: extract select options
2025-10-02 11:30:14 +02:00
Exequiel Arona
eff2bb2e42
feat: Add extraction for quick_list labels in workspace (#33304) 2025-07-14 19:43:56 +02:00
mergify[bot]
47650d75ff
fix: translatable string extraction (#32142) (#32148)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-04-15 17:43:52 +00:00
Akhil Narang
84ef6ec677
refactor: fixup with ruff 0.8.1
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 13:18:04 +05:30
David Arnold
c114e5fae8
refactor: unit vs integration treewide (#27992)
* refactor: constitute unit test case

* fix: docs and type hints

* refactor: mark presumed integration test cases explicitly

At time of writing, we now have at least two base test classes:

- frappe.tests.UnitTestCase
- frappe.tests.IntegrationTestCase

They load in their perspective priority queue during execution.

Probably more to come for more efficient queing and scheduling.

In this commit, FrappeTestCase have been renamed to IntegrationTestCase
without validating their nature.

* feat: Move test-related functions from test_runner.py to tests/utils.py

* refactor: add bare UnitTestCase to all doctype tests

This should teach LLMs in their next pass that the distinction matters
and that this is widely used framework practice
2024-10-06 09:43:36 +00:00
Raffael Meyer
06e963c365
fix: extract translatable strings from the whole repo (#27848) 2024-09-24 15:55:46 +02:00
Corentin Forler
9a2ce010f9
fix(translate): Don't extract from gitignored files (#27498) 2024-09-20 12:18:28 +02:00
Raffael Meyer
fd09008e07
fix: extract translatable headings and paragraphs from workspaces (#27464) 2024-08-20 21:55:39 +00:00
Corentin Forler
35fb0e2687
fix(translate): Fix extraction in JS files (#27401)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2024-08-14 12:25:44 +00:00
Raffael Meyer
6da35eca45
fix: disable fuzzy matching while updating po files (#27257) 2024-07-30 19:06:12 +00:00
Raffael Meyer
f75da85d83
fix: remove context from translatable strings in Workspace (#27249) 2024-07-30 20:14:57 +02:00
barredterra
5f1b33e1fb fix: docstring 2024-06-27 18:39:54 +02:00
barredterra
47d79b168d refactor: extract common methods for parsing df and links 2024-06-27 18:38:05 +02:00
barredterra
aa43edf1d6 refactor: move EXCLUDE_SELECT_OPTIONS to utils 2024-06-27 18:07:07 +02:00
barredterra
fb6f8658a6 feat: extractor for customizations
Added extraction for property setters and links
2024-06-27 18:02:45 +02:00
barredterra
65ab855571 refactor: extractor for custom fields 2024-06-27 17:36:55 +02:00
barredterra
4c924a5a16 Merge remote-tracking branch 'upstream/develop' into feat-translation-customizations 2024-06-27 17:22:50 +02:00
barredterra
7d20ab10e5 fix: remove DocType as translation context 2024-06-26 19:22:53 +02:00
Corentin Flr
ace4ea328b
fix(translate)!: Don't add decontextualized translations 2024-05-14 11:00:46 +02:00
Exequiel Arona
2263acf80c
feat: workspace extraction improvements (#26169)
* feat: add extractor for count format of shortcut

* feat: add extraction of description string
2024-04-30 16:14:34 +05:30
barredterra
b530de4098 fix: don't extract icon names 2024-04-29 11:41:19 +02:00
barredterra
530aaaec26 refactor: remove redundant excluded fields
These are already caught by the `option.isdigit()` check.
2024-04-29 11:40:02 +02:00
Exequiel Arona
dc64678625
fix: clean up print (#26170) 2024-04-26 18:22:33 +05:30
Exequiel Arona
0da9dd8aaa fix: linter 2024-04-25 13:17:12 -03:00
Exequiel Arona
5c1859e6a5 feat: add extractor for custom fields in customizations 2024-04-25 12:57:27 -03:00
Exequiel Arona
19acb40c7b feat: add extractor for custom fields in fixtures 2024-04-25 12:56:39 -03:00
Ankush Menat
bc26ab67dc
fix: runtime error during pot build (#25991) 2024-04-17 14:26:31 +05:30
barredterra
1a1cdf21bf fix: exclude some untranslatable select options 2024-04-04 11:50:33 +02:00
barredterra
0e573fc77e feat: move languages to CSV file, add enabled property
Only enable supported laguages.
2024-03-27 00:18:36 +01:00
Exequiel Arona
9a0761f1c0
fix: suggested correction applied
frappe/gettext/extractors/doctype.py

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2024-03-19 00:04:22 -03:00
Exequiel Arona
9033f5c65d feat: add description of doctype to extractor 2024-03-18 19:26:32 -03:00
Exequiel Arona
7042a6f63d
feat: add extractor for label of number card (#25414) 2024-03-15 15:48:10 +05:30
Raffael Meyer
609e0c12ff
feat: extract translatable strings from JS template strings (#24904) 2024-02-19 11:08:25 +05:30
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Ankush Menat
aad0c19f3a
fix: lazy translate circular imports (#24672)
* Revert "fix: remove _lt from frappe.model.std_fields (#24662)"

This reverts commit 833d108614.

* fix: circular import
2024-02-01 12:27:25 +00:00
barredterra
10cfcbed67 feat: turn jinja extractor into a generic HTML template extractor
... supporting both jinja and JS microtemplates
2024-01-19 16:22:54 +01:00
barredterra
368283769f refactor: move extract_messages_from_code to a separate utils file
In order to avoid circular imports.
2024-01-19 16:16:38 +01:00
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