# interface \SmartInterfaceAdapterTextTranslations
{ } ^::

Abstract Inteface Smart Adapter Text Translations

- Language: PHP
- Located at: lib/core/lib_translations.php
- Package: development:Application
- Namespace: \
- Interface Name: SmartInterfaceAdapterTextTranslations
- Version: v.20231030
- Internal-Private: YES

## interface Methods

abstract public static function getTranslationsVersion ( ) {} ::
Get Regional Text containing the Latest Version of the Translations
This function must implement a way to get last version string to validate Text Translations.
If a version cannot be provided, must return (string) date('Y-m-d') and this way the texts persistent cache will be re-validated daily.
If a real version can be provided it is the best, so persistent cache would be re-validated just upon changes !
RETURN: a non-empty string the provides the latest version string of the current texts translations
abstract public static function getTranslationsFromSource ( string $the_lang, string $y_area, string $y_subarea ) {} ::
Get Regional Text Translation from Source by: Language, Area, Subarea
This function must implement a Text Translations parser.
It can be implemented to read from one of the variety of sources: Arrays, INI, YAML, XML, JSON, SQLite, PostgreSQL, MySQL, MongoDB, GetText, ...
RETURN: an associative array as [key => value] for the specific translation set
abstract public static function setTranslationsKeyUsageCount ( string $the_lang, string $y_area, string $y_subarea, string $y_textkey ) {} ::
Register the usage (increment counter or register in logs) for a Regional Text Translation into Source or alternate source by: Language, Area, Subarea, Key
This function must implement a way to increment or register the usage of every used pair of Language/Area/Subarea/Key as it was used to help the cleanup of unused translations.
This function will operate only in DEV mode only (SmartEnvironment::ifDevMode() === true) ; for filesystem based adapters must also set in init.php: const SMART_FRAMEWORK__DEBUG__TEXT_TRANSLATIONS = true;
It can be implemented to write into one of the variety of sources: Text/CSV, Database, ...
RETURN: N/A

## interface Properties

## interface Constants

documentation generated on: 2024-12-16 16:53:45 +0000

Smart.Framework © 2009-2024 unix-world.org