Commit ee28e40c authored by Tim Bozeman's avatar Tim Bozeman Committed by Tim Bozeman
Browse files

Issue #3325340 by Tim Bozeman: Translation improvements

parent dee2a1e8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -77,6 +77,16 @@ class Variant extends RelationshipPluginBase {

    $locations = $this->locationHandler->getLocationLineage($location_code);

    // Are we in a workspace?
    if ($this->moduleHandler->moduleExists('workspaces')) {
      $workspace_manager = \Drupal::service('workspaces.manager');
      if ($workspace_manager->hasactiveworkspace()) {
        $field_data_table = $def['field_data_revision'];
        $variant_reference = $def['base_revision'];
        $location_field = 'variant_revision__locations';
      }
    }

    // Normally with a variation code like ko-2 you would extract the ko part
    // with SUBSTRING_INDEX(langcode, '-', 1). We need to be able to extract the
    // langcode zh-hant from zh-hant-0 as well though. Lets flip the string over