Returns true if key exists in the given locale
778563
def key_exists?(key, locale)
      I18n.locale = locale
      I18n.translate(key, raise: true)
      return true
    rescue I18n::MissingInterpolationArgument
      return true
    rescue I18n::MissingTranslationData
      return false
    end
1119737
public function has($key, $locale = null) {
        $locale = $this->locale($locale);

        return $this->get($key, [], $locale) !== $key;
    }
658164
def one_translation_per_lang_per_key
      translation_exists = Translation.exists?(
        lang: self.lang,
        translator_id: self.translator.id,
        translator_type: self.translator.class.name,
        translation_key_id: self.key.id
      )

      unless translation_exists
        true
      else
        false
        self.errors.add(:lang, I18n.t('.one_translation_per_lang_per_key'))
      end
    end
800855
static function idByLocale( $locale )
    {
        $language = eZContentLanguage::fetchByLocale( $locale );
        if ( $language )
        {
            return (int)$language->attribute( 'id' );
        }
        else
        {
            return false;
        }
    }
1066149
protected boolean hasI18nKey(final String aMessageKey) {
        return myBundle != null && aMessageKey != null && myBundle.containsKey(aMessageKey);
    }
520839
public function checkLanguage(string $key): bool
    {
        $locale = $this->getOption('locale', []);

        if (array_key_exists($key, Arr::wrap($locale))) {
            return filter_var($locale[$key], FILTER_VALIDATE_BOOLEAN);
        }

        return false;
    }
189567
function hasKey(key) {
    return data.meta[key] !== undefined
      && (self.lookup[key] === null ||
      self.lookup[key] === data.meta[key]);
  }
156478
public function isAtLeastOneLocalPrimaryKey()
    {
        $localCols = $this->getLocalColumnObjects();

        foreach ($localCols as $localCol) {
            if ($this->getTable()->getColumn($localCol->getName())->isPrimaryKey()) {
                return true;
            }
        }

        return false;
    }
165554
public function get($key, $locale = null)
    {
        if(!$locale){
            $locale = $this->getLocale();
        }

        if($locale == config('translator.default')){
            return $key;
        }

        $this->load($locale);

        if (!isset($this->languages[$locale][$key])){
            $this->setMissing($key, $locale);
            return $key;
        }

        return $this->languages[$locale][$key]["value"];
    }
168289
public boolean containsKey(String key, Charset charset)
    {
        return meta.containsKey(BinaryValue.unsafeCreate(key.getBytes(charset)));
    }
1339499
private function getRealKey(string $key, string $locale = null): string
    {
        if (!$locale) {
            $locale = $this->defaultLanguage;
        }
        
        if (\strpos($key, '.') === false) {
            $key = implode([$this->defualtCategory, $key], '.');
        }

        return implode('.', [$locale, $key]);
    }
1114214
public <T> T getField(String locale, String key) {
    return localize(locale).getField(key);
  }
504176
def with_given_locale(attributes, &block)
      attributes.symbolize_keys! if attributes.respond_to?(:symbolize_keys!)
      if locale = attributes.try(:delete, :locale)
        Mongoid::Globalize.with_locale(locale, &block)
      else
        yield
      end
    end
1222949
public function isAtLeastOneLocalPrimaryKeyIsRequired()
    {
        foreach ($this->getLocalPrimaryKeys() as $pk) {
            if ($pk->isNotNull() && !$pk->hasDefaultValue()) {
                return true;
            }
        }

        return false;
    }
630481
public String getLang(final Locale locale, final String key) {
        return langs.get(locale.toString()).getProperty(key);
    }
656030
private function hasLocale(string $locale): bool
    {
        assert(empty($locale) === false);

        $result = in_array($locale, $this->getLocales());

        return $result;
    }
712083
def has_key(self, key):
        """"""
        k = self._lowerOrReturn(key)
        return k in self.data