Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-6536

Ensure WPML doesn't localize feature settings

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Merged
    • Icon: Must have Must have
    • 2.71.3
    • None
    • 5
    • Translations
    • Sprint #176
    • deimos

      The feature settings could be set individually per language because we register all Planet 4 options for translation. However these settings should have the same value for all languages, so we should exclude them from translation to avoid tedious work and possible configuration mismatches.

      The ticket was first created assuming a WPML config file would allow us to configure per setting whether it should be translated or not. Unfortunately this turns out to not work for us, which wasn't clear from WPML's documentation.

      Instead we solved the same issue by moving the feature settings to a separate wp_option key, so that we can exclude translation on that key entirely. This is possible because all settings inside the features page are not supposed to be translated.

      This change only affects the underlying storage, the admin UI is unchanged.

      Most of the other existing options are supposed to be translated, or are a one time setup that doesn't need to change like feature settings d.

      We can clean up the entries in the regular config once the migration ran successfully.

      To investigate:

      • Which values will it use when changing an option from "per language" to global? It will use the settings of the default language, which WPML stores without language prefix.
      • Clean up obsolete language specific database records in wp_options after an option was made global? Yes, in a follow up. That way we don't remove the records before we're sure the new ones work.

      Original description (not entirely accurate anymore)

      We should add a configuration file to ensure certain options can only be set globally instead of per language.

      Currently settings that should be site wide are being "localized" per language, making managing features more tedious and error prone. Every setting needs to be managed 2 times (or even 3 in some cases), and it's easy to forget changing one of the languages.

      Certain options should still be different per language, for example in case they contain translatable text. But many others could be made global.

      WPML allows controlling this behavior this with a configuration file. It should also work on serialized arrays, which we use for Planet 4 options.

      Perhaps we should also display whether a particular option can be different per language on the settings page. Or make separate settings pages combining all translatable settings.

            pvincent Pieter Vincent (Inactive)
            pvincent Pieter Vincent (Inactive)
            Florent Hernandez Florent Hernandez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: