Method |
Description |
|
__construct ( Waavi\Translation\Models\Translation $model, Illuminate\Foundation\Application $app ) : void |
Constructor |
|
allByLocale ( string $locale, $perPage ) : Waavi\Translation\Models\Translation |
Return a list of translations for the given language. If perPage is > 0 a paginated list is returned with perPage items per page. |
|
create ( array $attributes ) : boolean |
Insert a new translation into the database. |
|
delete ( integer $id ) : boolean |
Delete a translation. If the translation is of the default language, delete all translations with the same namespace, group and item |
|
deleteByCode ( string $code ) : boolean |
Delete all entries by code |
|
findByCode ( string $locale, string $namespace, string $group, string $item ) : Waavi\Translation\Models\Translation |
Find a translation per namespace, group and item values |
|
findByLangCode ( string $locale, $code ) : Waavi\Translation\Models\Translation |
Find a translation per namespace, group and item values |
|
flagAsReviewed ( integer $id ) : boolean |
Flag the entry with the given id as reviewed. |
|
flagAsUnstable ( $namespace, $group, $item ) : boolean |
Flag all entries with the given namespace, group and item and locale other than default as pending review. |
|
getItems ( string $locale, string $namespace, string $group ) : array |
Return all items for a given locale, namespace and group |
|
loadArray ( array $lines, string $locale, string $group, string $namespace = '*' ) : void |
Loads a localization array from a localization file into the databas. |
|
loadSource ( string $locale, string $namespace, string $group ) : array |
Return all items formatted as if coming from a PHP language file. |
|
parseCode ( string $code ) : boolean |
Parse a translation code into its components |
|
pendingReview ( string $locale, integer $perPage ) : Waavi\Translation\Models\Translation |
Retrieve translations pending review for the given locale. |
|
randomUntranslated ( string $locale ) : Waavi\Translation\Models\Translation |
Find a random entry that is present in the default locale but not in the given one. |
|
search ( string $locale, string $partialCode, integer $perPage ) : Waavi\Translation\Models\Translation |
Search for entries given a partial code and a locale |
|
translateText ( string $text, string $textLocale, string $targetLocale ) : array |
Check if there are existing translations for the given text in the given locale for the target locale. |
|
untranslated ( string $locale, integer $perPage, string $text = null ) : Collection |
List all entries in the default locale that do not exist for the target locale. |
|
update ( $id, $text ) : boolean |
Update a translation. |
|
updateAndLock ( $id, $text ) : boolean |
Update and lock translation. Locked translations will not be ovewritten when loading translation files into the database. |
|
updateDefaultByCode ( string $code, string $text ) : boolean |
Insert or Update entry by translation code for the default locale. |
|
validate ( array $attributes ) : boolean |
Validate the given attributes |
|
validationErrors ( ) : Illuminate\Support\MessageBag |
Returns the validations errors of the last action executed. |
|