Tiger_Model_Translation

@api · extends Tiger_Model_Table

Translation — live translation overrides (the DB tier of i18n; see migration 0013).

File translations (core/app/module languages//.php) are the base; rows here OVERRIDE or ADD strings at REQUEST time with no deploy — the same idea as the config table for config. Read by Tiger_Application_Bootstrap::_initTranslate and layered on top of the files (last wins). Scopes: global (platform-wide) and org (per-tenant, reserved for later). Keys are owner-prefixed semantic keys (core., app., .); locale is language-only (en, es).

Methods

getForLocale()

getForLocale($locale, $scope = self::SCOPE_GLOBAL, $scopeId = '')

Overrides for a locale + scope as a key => value map, ready to hand to Zend_Translate::addTranslation.

  • $locale string — language-only locale (en, es)
  • $scope string — SCOPE_GLOBAL | SCOPE_ORG
  • $scopeId string — scope discriminator (org id for SCOPE_ORG, '' otherwise)

Returns array<string,string>

get()

get($locale, $scope, $scopeId, $key)

A single override value, or null.

  • $locale string — language-only locale (en, es)
  • $scope string — SCOPE_GLOBAL | SCOPE_ORG
  • $scopeId string — scope discriminator (org id for SCOPE_ORG, '' otherwise)
  • $key string — owner-prefixed semantic translation key

Returns string|null — the override value, or null if none

set()

set($locale, $scope, $scopeId, $key, $value)

Upsert one override. Returns the translation_id.

  • $locale string — language-only locale (en, es)
  • $scope string — SCOPE_GLOBAL | SCOPE_ORG
  • $scopeId string — scope discriminator (org id for SCOPE_ORG, '' otherwise)
  • $key string — owner-prefixed semantic translation key
  • $value string — the override text

Returns string — the translation_id (existing on update, generated on insert)