Commit graph

284 commits

Author SHA1 Message Date
sokumon
63cf3676a0 fix: remove utils file and typo 2025-06-17 18:39:21 +05:30
sokumon
422995cd45 fix: seperate backup options into app 2025-06-14 23:59:22 +05:30
Raffael Meyer
3b7df82a80
chore: remove unused method (#29163) 2025-01-14 21:39:09 +00:00
Ankush Menat
e37219ef39 perf: Store languages in client cache 2025-01-06 19:52:43 +05:30
Ankush Menat
41d4155bba perf: Use system settings directly for fetching language 2024-12-26 11:52:44 +05:30
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
Shariq Ansari
dfe427b8d0 fix: added api to get translation messages for portal apps 2024-12-02 17:47:43 +05:30
David (aider)
8e80ae7980
fix: Implement parent-child language precedence in get_all_translations 2024-09-21 01:56:07 +02:00
Lyes7
9b89eba337 fix: workflow typos 2024-09-12 10:18:49 +01: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
Ankush Menat
c17eb87c70
perf: Reuse cached user for get_user_lang (#26350)
Saves ~1% of overhead.

User doc is almost always cached to create session so we can reuse it in
same request without additional redis call.
2024-05-07 12:50:22 +05:30
Ankush Menat
56233f3182 chore: dead hooks 2024-05-04 15:08:32 +05:30
Ankush Menat
b7bc5d3236
fix(round 3): switch to creation sorting (#25669) 2024-03-27 08:59:04 +00:00
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Ankush Menat
0a886b7ca8 perf: defer imports during CLI 2024-02-19 18:10:07 +05:30
lbrandh
4ceb5c32b7
fix: preferred_language cookie (#24819) 2024-02-09 13:59:44 +00:00
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
Akhil Narang
f19c25ec42
Merge pull request #24432 from blaggacao/chore/cleanup-frappe-connect-2
chore: cleanup frappe connect II/II
2024-02-02 16:53:19 +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
David Arnold
c57bc94ead
chore: cleanup frappe.connect invocations 2024-01-24 11:56:24 +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
Ankush Menat
b3eaec4347
fix: misc (#24303)
* fix(DX): improve logging in various places

* fix(ux): misc RQ worker and job fixes
2024-01-13 10:54:38 +05:30
Ankush Menat
98b62e8220 fix: add _lt to extractors 2024-01-10 21:47:55 +05:30
Ankush Menat
1f6201b4af feat: lazy global translated strings 2024-01-10 21:28:01 +05:30
Ankush Menat
f246f37762 fix: language variants support 2024-01-10 18:27:57 +05:30
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
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
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
barredterra
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
HarryPaulo
4203c3b13d fix: load languages that have capital letters 2023-11-20 22:31:12 -03:00
barredterra
e3ff2456ef chore: remove unused method 2023-11-06 19:46:34 +01:00
Raffael Meyer
f0155674a5
refactor!: remove redundant sending of translations (#22962)
* chore!: remove redundant translation

* refactor!: remove "get_translated_dict" hook

Instead, include the results from
`frappe.geo.country_info.get_translated_dict` in `get_all_translations`.

* test: money_in_words uses translated currency

... and now we have translations.

* Revert "test: money_in_words uses translated currency"

This reverts commit e07d594ac1ce4b120c0fceb5d23377cb981fe820.

* refactor!: stop translating timezone and currency

* refactor: rename `get_translated_dict`

... to `get_translated_countries`
2023-11-02 20:04:14 +05:30
barredterra
41b0308951 refactor: use higher level get_app_path
It's just nicer to read; less mental load.
2023-08-21 17:15:45 +02:00
barredterra
88c8baa9ee refactor: for append to extend, merge list extend
Replace a for append loop with list extend.
Create the list with values instead of creating
an empty list and extending it with another list.
2023-08-09 13:25:39 +02:00
barredterra
b553ed98d8 refactor: inline immediately returned variable
Inline a variable to a return in the case when the
variable being declared is immediately returned
2023-08-08 18:09:49 +02:00
Sagar Vora
d2becc7f1d fix: no API call required to set cookie in browser 2023-07-22 17:54:41 +05:30
Ankush Menat
c6419f52e2 perf: Move babel import to extract function
This is never used in production.

[skip ci]
2023-06-23 14:13:53 +05:30
Anand Baburajan
38960f4219
feat: migrate translations command (#21362)
* feat: migrate translations command

* chore: formatting
2023-06-19 18:19:07 +05:30
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
Ankush Menat
0b8b829483 perf: dont cache intermediate translation files
Just caching final files for each language is enough, duplicating
doesn't help much.
2023-04-11 12:10:49 +05:30
Ankush Menat
361e44de1d fix(translations)!: load translation in installed order
- translations are loaded in apps.txt order this doesnt make much sense.
- translations are loaded from apps which aren't even installed, again
  doesn't make sense.

Breaking but necessary change.
2023-04-11 12:10:45 +05:30
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Ankush Menat
1b1e4de35e
chore!: dead code (#19551)
This was added for some very old patch code.

[skip ci]
2023-01-10 18:53:08 +05:30
Ankush Menat
e00023deb1 refactor: replace bad usage of db.set_value 2023-01-04 11:13:53 +05:30
Gavin D'souza
d3250f6504 refactor(whitelisted): Add typing hints to APIs
* Refactor type checks defined in APIs
* Remove dead/deprecated kwargs usages
* Added appropriate hints to APIs and consecutive utils defined in the following modules:
 - frappe.realtime
 - frappe.translate
 - frappe.utils.global_search
 - frappe.www.third_party_apps
 - frappe.www.search
 - frappe.www.printview
2022-12-15 13:47:05 +05:30
barredterra
67ede5d533 feat: add parameters language and letter_head to download_pdf 2022-12-14 13:59:46 +01:00
Ankush Menat
a1a296ac75
fix: ignore global translations (#18733)
_("string") outside of function/methods don't make any sense cause they
are initialized the moment module is imported. This is already checked
in CI yet people make this mistake.

Ignore and refuse to translate in those cases.
2022-11-03 03:00:03 +05:30