How to export translations of custom Views?

Created on 27 August 2024, 10 months ago

Problem/Motivation

I translated a custom view from English to German. Now I tried to export the view. This export is english only.

How can I export the German translation?

I tried

  • Interface translation export, export does not contain the translation
  • Configuration translation, nothing found, No export feature
  • Configuration export, cannot find anything helpful

I do not like to use all the translations now as this is a migration and I need to drop DB a few times.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ’¬ Support request
Status

Active

Version

10.3 ✨

Component
ViewsΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡©πŸ‡ͺGermany marc.bau

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @marc.bau
  • Status changed to Postponed: needs info 10 months ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    On a clean Umami install (which contains english and spanish out of the box) I go to /admin/config/development/configuration/full/export and then export the config it contains a 'es' folder that contains all the spanish config, including the Views.

    Not sure what you are looking for, that config should just be exported along with the other config.

  • πŸ‡©πŸ‡ͺGermany marc.bau

    I translated several custom views from English to German in a development system. But I cannot find a way to export my dev translations to import them into the production system. That means my hard translation work get lost.

    How can I transfer the translations of my custom views (not the module) to other systems? I simply cannot find the translated strings in any export I tried out.

  • Status changed to Active 10 months ago
  • Status changed to Postponed: needs info 10 months ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    my custom views (not the module)

    What does that mean? Are they Views from the Views module or are they database view tables?

  • πŸ‡©πŸ‡ͺGermany marc.bau

    You click the "Add view" button and create your own by hand - and save it later in the database. Than you translate the stuff... and now I need the translation on a different system and how I can export these translations?

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    To my knowledge there is no way in core for exporting translations

  • πŸ‡©πŸ‡ͺGermany marc.bau

    That sounds really bad… data loss is really al problem and redoing the translation is waste of time.

    Should we convert the case to a feature request now?

  • πŸ‡©πŸ‡ͺGermany marc.bau
  • πŸ‡©πŸ‡ͺGermany marc.bau
  • πŸ‡©πŸ‡ͺGermany marc.bau
  • πŸ‡©πŸ‡ͺGermany marc.bau
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    May be something that needs sign off if it’s to be included in core or should be a contrib feature

  • πŸ‡©πŸ‡ͺGermany marc.bau

    Thanks for sharing. I take a look if they fill the gap and export the custom views only.

  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Sorry, I still don't understand the problem. Views translations are like any other config translation, and they get exported along with all the other config when you export it. This works fine.

    Are you exporting config one thing at a time or something like that when you move things from dev to prod? And not the whole config folder at once? I've never done that (and that sounds like a lot of work), but in that case you might have to export the translations separately since they are their own config object I think.

  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    The examples @smustgraves provides are for interface translation and not config translation, so I don't think those would apply here, but if they are I would recommend using https://www.drupal.org/project/potx β†’ just to make the list complete

  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    I just checked and if you are moving things one by one via /admin/config/development/configuration/single/export, you are correct, I don't see an export feature for translations there. But that goes for all entities, that has nothing to do with Views specifically.

    And the workaround would be to export the full config and manually grab the translation files from there.

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    @marc.bau: It would be great if you outlined in detail:

    • The steps you take (which pages, which buttons, etc.)
    • The expected outcome
    • What happened
    • How you like it to work

    I have just worked with translations, and had a hard time understanding how it all ties together -- like "There's interface translation AND configuration translation, working in each their own way, huh?".

    There are many different methods, so understandably, we all have a hard time understanding your challenge, unless you supply the details. Do you want to use a .po file, do you use Drush, the interface, or something else ... If you are moving .yml files individually, if yes, from which folders, etc.

    Also, what exactly do you mean with a "custom view"? Like, if it's just clicking on the button and creating a View, I wouldn't consider that "custom", that's just a View, in my opinion. When you use the word "custom", we start thinking that perhaps you coded it in some strange way, but maybe you didn't? In other words, if you created the View with the regular method, you can drop the word "custom".

Production build 0.71.5 2024