Open klonos opened 3 months ago
Caution! Views does "its own thing" with translations.
There's a views setting to enable translation of certain strings (on by default) admin/structure/views/settings/advanced
So, things like views titles are always translatable out of the box. This has nothing to do with config translation.
There's a views setting to enable translation of certain strings (on by default) admin/structure/views/settings/advanced
Yup 👍🏼 ...I made sure to check that on a vanilla Backdrop site, and it is set to "Core" by default.
So, things like views titles are always translatable out of the box.
Nope 👎🏼 ...I've tested that in great detail over in #6610, and that is not the case at all. Here's a simpler way to reproduce this:
admin/config/regional/language
and add another language. You can choose any language, but prefer to add Catalan, since that one has the least amount of untranslated strings in https://localize.backdropcms.org currentlyadmin/config/regional/translate/translate
and try to search for image library
or image
or library
-> "No strings available."admin/config/regional/translate/import
and import the translations you downloaded.
admin/config/regional/translate/translate
and search for image library
-> you are getting more results now, including the string Select from Image Library
(which is hardcoded - see #6511) ...but you are not getting the plain Image Library
string, which is the label of the image_library
view.promoted
for instance -> you get many strings with that word, however the "Promoted cards" label for the promoted_cards
view is not there.ABC 123
. Repeat the search -> nothing 👎🏼 @indigoxela if what you say about views strings always being translatable, then shouldn't the labels of the image_library
, promoted_cards
etc. views be available for translation then? Something is definitely not working as expected. Am I missing something important here?
...if I'm doing this whole thing wrong, then I'm happy to be shown how it should be done properly. The goal is to be able to translate views labels/descriptions for starters.
@klonos multilingual can be a bit tricky for starters.
There's multiple ways, how Locale picks up strings. The one that applies to views is visiting the view via UI. At the moment, the view got imported, but the interface hasn't been visited, yet, Locale isn't aware of the new strings. To make it aware, visit the view (admin UI or a page...).
It's also necessary to have more than one language enabled on a site. Otherwise views_plugin_localization_core::save_string won't add the string and Locale won't be aware of it.
Thank you for providing all that insight @indigoxela ...it saves me a lot of time 🙏🏼
The one that applies to views is visiting the view via UI. At the moment, the view got imported, but the interface hasn't been visited, yet, Locale isn't aware of the new strings. To make it aware, visit the view (admin UI or a page...).
That's very interesting 🤔 @laryn mentioned the same in the Zulip thread:
You need to load some pages that use t() after that's all enabled, I believe.
So I tested that, and it still doesn't work for me. I visited the Views listing page, the configuration forms for the image_library
and promoted_cards
views, the pages/dialogs these views are producing. Yet, when I go back to admin/config/regional/translate/translate
and search for "promoted" or "library", the labels of these views are not coming up in the results. I'm curious: when you search for these terms in the sites you are managing, do the views names come up?
It's also necessary to have more than one language enabled on a site.
Yes 👍🏼 ...my initial testing was done with only English, but I have also enabled other languages after that and tested again and again. I currently have for example English, Catalan and Greek enabled + imported their most recent .po files from https://localize.backdropcms.org. Still, the views labels are not showing up for me 🤷🏼
Specifically about the fact that you need more than one language, I agree, but we are not making that clear. We are showing elements in the UI that we should not be showing when only one language is enabled, but I am leaving all that for #6610 - I don't want to derail this issue here with all that.
FTR, I just jumped in here for a short hint, how to trigger string addition in Locale. Neither do I want to go further into details, nor do I want to start (or get involved in) any issue re rewriting our multilingual system. :laughing:
Just a short hint... and gone again. :wave:
Thanks again @indigoxela 🙏🏼 👋🏼
FTR (for others that come to this thread here): all I'm trying to do is to translate the name of even one single view. At the moment, I cannot do that. I have explained the steps that I am following. If I am doing something wrong, then please let me know what that is. I think that I have followed the right steps, which is now driving me crazy. So some sanity check please.
@klonos I've checked the issue, and indeed I wasn't able to translate the view name or a views display name.
Other strings are however translatable after adding them to a view. For instance:
Thanks for taking the time to test and confirm @olafgrabienski 🙏🏼 ...can you please clarify what you mean by this?:
... view name or a views display name
...I'm assuming that by one of them you mean the "Human-readable name" field, but what is the other thing that is not translated?
@klonos Sure, as soon you have more displays than the Default display, the displays get a name, e.g. Block, Feed etc. See screenshot below.
Display name (editing in the modal):
Thanks for clarifying @olafgrabienski 🙏🏼 ...one of the bullet points in your earlier reply though is "Display title", which you mention as being translatable. What is that then?
The discussion around this was brought up in #4137, which is to discuss whether a specific translation-related commit in Views 7.x needs to be crossposted or not.
This was also discussed during this week's dev meeting, as part of the discussion around other issues (like #6511 and #6512). It was 40:13 into the recording. Here: https://youtu.be/CTPd63wSpAg?t=2413
During the meeting, we decided that it would be better if we created a separate issue and PR for the following:
_config_translatables
with the minimum being the strings for the views label, the display labels etc.