[ntp][modules] Fix viewed tags of recipe module in all languages
Currently, the viewed tags of the recipes module is not correct in all
languages. Examples of incorrect tags are:
* (German) "vor 1 Jahr angesehen" should be "Vor 1 Jahr angesehen"
* (Spanish) "Visto Hace 1 año" should be "Visto hace 1 año"
* (French) "Vu Il y a 1 an" should be "Vu il y a 1 an"
The root issue is that we piece the tag together from a template string
and a dynamically localized, relative timestamp. The individual pieces
do not always agree on the capitalization, creating the issue.
This CL fixes the issue by limiting the number of possible tag strings
to a handful, which are all individually translated as a unit. We then
map any given timestamp to one of those tag strings. This makes the tag
less precise but correct in all languages.
Fixed: 1286060
Change-Id: I090be23d49fb3a901f04faecb589f51e79fe7f3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3403488
Auto-Submit: Tibor Goldschwendt <[email protected]>
Reviewed-by: Mohamad Ahmadi <[email protected]>
Commit-Queue: Tibor Goldschwendt <[email protected]>
Cr-Commit-Position: refs/heads/main@{#961303}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 2fe63f2..4e6738e 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4017,6 +4017,8 @@
"new_tab_page/modules/task_module/task_module_service.h",
"new_tab_page/modules/task_module/task_module_service_factory.cc",
"new_tab_page/modules/task_module/task_module_service_factory.h",
+ "new_tab_page/modules/task_module/time_format_util.cc",
+ "new_tab_page/modules/task_module/time_format_util.h",
"new_tab_page/one_google_bar/one_google_bar_data.cc",
"new_tab_page/one_google_bar/one_google_bar_data.h",
"new_tab_page/one_google_bar/one_google_bar_loader.h",