Is a localized value already existing.

@param _propertyid   ID of the Property, the localized value is related to
@param _language     Language of the property
@return OID of the value, otherwise null
170532
private Instance getExistingLocale(final long _propertyid,
                                       final String _language)
    {
        Instance ret = null;
        try {
            final QueryBuilder queryBldr = new QueryBuilder(Type.get(DBPropertiesUpdate.TYPE_PROPERTIES_LOCAL));
            queryBldr.addWhereAttrEqValue("PropertyID", _propertyid);
            queryBldr.addWhereAttrEqValue("LanguageID", getLanguageId(_language));
            final InstanceQuery query = queryBldr.getQuery();
            query.executeWithoutAccessCheck();
            if (query.next()) {
                ret = query.getCurrentValue();
            }
        } catch (final EFapsException e) {
            DBPropertiesUpdate.LOG.error("getExistingLocale(String)", e);
        }
        return ret;
    }
730061
public function getByLangOrFirst($key, $languageId)
    {
        $templateId = EmailTemplate::getIdByKey($key);

        if ($template = EmailTemplateTranslation::findOne([
            'template_id' => $templateId,
            'language_id' => $languageId
        ])) {
            return Template::buildTemplate($template);
        }
        elseif ($templates = EmailTemplateTranslation::findAll([
            'template_id' => $templateId
        ])) {
            return Template::buildTemplate($templates[0]);
        }

        return null;
    }
1005252
public function find($id, $lang = null)
  {
    $results = $this->client->request([
      'ids' => $id,
      'languages' => $lang
    ]);

    if($results->isEmpty()) {
      return null;
    }

    return $results->first();
  }
1133746
public function getLanguageBySite($siteId)
    {
        if ($this->hasLanguageBySite($siteId)) {
            return $this->languageBySites[self::SITE_ID_PREFIX.$siteId];
        }

        return null;
    }
172264
public Object removeProperty( Object propertyId ) {
        return nodeProperties != null ? nodeProperties.remove(propertyId) : null;
    }
283181
@Override
    protected int findPropertyId(String propName)
    {
        Integer I = sProperties.get(propName);
        return (I == null) ? -1 : I.intValue();
    }
381257
@Nullable
  private Language getLanguageForLocalizedName(String languageName) {
    for (Language element : Languages.get()) {
      if (languageName.equals(element.getTranslatedName(messages))) {
        return element;
      }
    }
    return null;
  }
451007
public function id($var = null)
    {
        if ($var !== null) {
            // store unique per language
            $active_lang = Grav::instance()['language']->getLanguage() ?: '';
            $id = $active_lang . $var;
            $this->id = $id;
        }

        return $this->id;
    }
701758
public Object get(String propName) {
        if (propName.equals("value")) {
            return getValue();
        }
        if (propName.equals("lang")) {
            return getLang();
        }
        return null;
    }
437667
function message (id, language, data) {
  var genericMessage = 'GenericError'
  var self = this || message
  var str, key, subtag

  if (!self.hasOwnProperty(language)) {
    subtag = language && language.match(/.+?(?=-)/)
    if (subtag) subtag = subtag[0]
    if (self.hasOwnProperty(subtag)) language = subtag
    else language = self.defaultLanguage
  }

  str = self[language].hasOwnProperty(id) ?
    self[language][id] :
    self[language][genericMessage] || self.en[genericMessage]

  if (typeof str === 'string')
    for (key in data)
      str = str.replace('{' + key + '}', data[key])

  if (typeof str === 'function')
    str = str(data)

  return str
}
399154
public Properties getLables(JKLocale locale) {
		Properties properties = lables.get(locale);
		if (properties == null) {
			properties = new Properties();
			lables.put(locale, properties);
		}
		return properties;
	}
411235
public function hasValueByDsId($dsId, $language = null)
    {
        if (!$language) {
            $language = $this->defaultLanguage;
        }

        if (!isset($this->values[$language])) {
            return false;
        }

        foreach ($this->values[$language] as $value) {
            if ($value->getDsId() === $dsId) {
                return true;
            }
        }

        return false;
    }
694497
protected String getLocalType (int oid)
    {
        String type = _auxes.get(oid);
        return (type == null) ? PLACE_CHAT_TYPE : type;
    }
452565
@Nullable
  public Language getLanguage() {
    XComponent xComponent = OfficeTools.getCurrentComponent(xContext);
    Locale charLocale;
    XPropertySet xCursorProps;
    try {
      XModel model = UnoRuntime.queryInterface(XModel.class, xComponent);
      if(model == null) {
        return Languages.getLanguageForShortCode("en-US");
      }
      XTextViewCursorSupplier xViewCursorSupplier =
          UnoRuntime.queryInterface(XTextViewCursorSupplier.class, model.getCurrentController());
      XTextViewCursor xCursor = xViewCursorSupplier.getViewCursor();
      if (xCursor.isCollapsed()) { // no text selection
        xCursorProps = UnoRuntime.queryInterface(XPropertySet.class, xCursor);
      } else { // text is selected, need to create another cursor
        // as multiple languages can occur here - we care only
        // about character under the cursor, which might be wrong
        // but it applies only to the checking dialog to be removed
        xCursorProps = UnoRuntime.queryInterface(
            XPropertySet.class,
            xCursor.getText().createTextCursorByRange(xCursor.getStart()));
      }

      // The CharLocale and CharLocaleComplex properties may both be set, so we still cannot know
      // whether the text is e.g. Khmer or Tamil (the only "complex text layout (CTL)" languages we support so far).
      // Thus we check the text itself:
      if (new KhmerDetector().isThisLanguage(xCursor.getText().getString())) {
        return Languages.getLanguageForShortCode("km");
      }
      if (new TamilDetector().isThisLanguage(xCursor.getText().getString())) {
        return Languages.getLanguageForShortCode("ta");
      }

      Object obj = xCursorProps.getPropertyValue("CharLocale");
      if (obj == null) {
        return Languages.getLanguageForShortCode("en-US");
      }
      charLocale = (Locale) obj;
      boolean langIsSupported = false;
      for (Language element : Languages.get()) {
        if (charLocale.Language.equalsIgnoreCase(LIBREOFFICE_SPECIAL_LANGUAGE_TAG)
            && element.getShortCodeWithCountryAndVariant().equalsIgnoreCase(charLocale.Variant)) {
          langIsSupported = true;
          break;
        }
        if (element.getShortCode().equals(charLocale.Language)) {
          langIsSupported = true;
          break;
        }
      }
      if (!langIsSupported) {
        String message = Tools.i18n(messages, "language_not_supported", charLocale.Language);
        JOptionPane.showMessageDialog(null, message);
        return null;
      }
    } catch (Throwable t) {
      MessageHandler.showError(t);
      return null;
    }
    return getLanguage(charLocale);
  }
1073117
public static synchronized I18N getInstance(String sessionId) {
        if (!sessionInstances.containsKey(sessionId)) {
            sessionInstances.put(sessionId, new DefaultI18N());
        }
        return sessionInstances.get(sessionId);
    }
1163563
public static boolean isKnownById(int id) {
        final String hexId = Utils.supplyZero(Integer.toHexString(id).toUpperCase(), 4);
        
        String code = messageResolver.getMessage(String.format("locale.%s.code", hexId));
        return Utils.isNotEmpty(code);
    }
806777
public function getPage(int $uid, int $languageUid = null) {
    $page   = null;
    $record = Page::find($uid);

    if ($record) {
      $record = $record->getAttributes();

      if (is_array($record) && !empty($record) && in_array($record['doktype'], self::PAGE_DOKTYPES)) {
        $page                  = $record;
        $l18nCfg               = isset($page['l18n_cfg']) ? $page['l18n_cfg'] : 0;
        $hideIfDefaultLanguage = (boolean) GeneralUtility::hideIfDefaultLanguage($l18nCfg);
        $hideIfNotTranslated   = (boolean) GeneralUtility::hideIfNotTranslated($l18nCfg);
        $languageUid           = isset($languageUid) ? $languageUid : $this->languageService->getLanguageUid();

        if ($hideIfDefaultLanguage) {
          $page['hidden'] = 1;
        }

        if ($languageUid > 0) {
          $constraints     = [['pid', '=', $uid], ['sys_language_uid', '=', $languageUid], ['deleted', '=', 0]];
          $languageOverlay = LanguageOverlay::where($constraints)->first();

          if ($languageOverlay) {
            $languageOverlayAttributes = [];
            $attributes                = $languageOverlay->getAttributes();

            foreach (self::PAGE_LANGUAGE_OVERLAY_ATTRIBUTES as $attribute) {
              if (is_string($attributes[$attribute]) && empty($attributes[$attribute])) {
                continue;
              }

              $languageOverlayAttributes[$attribute] = $attributes[$attribute];
            }

            $page = array_merge($page, $languageOverlayAttributes);

            if ($this->extensionService->runningInFallbackMode() && !$hideIfDefaultLanguage && !$hideIfNotTranslated) {
              $page['hidden'] = 0;
            }
          }
        }
      }
    }

    return $page;
  }