[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-includes/things/ -> translation-set.php (summary)

Things: GP_Translation_Set class

File Size: 742 lines (21 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

GP_Translation_Set:: (23 methods):
  restrict_fields()
  normalize_fields()
  name_with_locale()
  by_project_id_slug_and_locale()
  by_locale()
  existing_locales()
  existing_slugs()
  by_project_id()
  import()
  waiting_count()
  untranslated_count()
  fuzzy_count()
  current_count()
  warnings_count()
  all_count()
  update_status_breakdown()
  copy_translations_from()
  percent_translated()
  last_modified()
  delete()
  after_create()
  after_save()
  after_delete()


Class: GP_Translation_Set  - X-Ref

Core class used to implement the translation sets.

restrict_fields( $rules )   X-Ref
Sets restriction rules for fields.

since: 1.0.0
param: GP_Validation_Rules $rules The validation rules instance.

normalize_fields( $args )   X-Ref
Normalizes an array with key-value pairs representing
a GP_Translation_Set object.

return: array Normalized arguments for a GP_Translation_Set object.
since: 1.0.0
param: array $args Arguments for a GP_Translation_Set object.

name_with_locale( $separator = '→' )   X-Ref
Returns the English name of a locale.

If the slug of the locale is not 'default' then the name of the
current translation sets gets added as a suffix.

return: string The English name of a locale.
since: 1.0.0
param: string $separator Separator, in case the slug is not 'default'. Default: '→'.

by_project_id_slug_and_locale( $project_id, $slug, $locale_slug )   X-Ref
No description

by_locale( $locale_slug )   X-Ref
No description

existing_locales()   X-Ref
No description

existing_slugs()   X-Ref
No description

by_project_id( $project_id )   X-Ref
No description

import( $translations, $desired_status = 'current' )   X-Ref
Import translations from a Translations object.

return: boolean or void
param: Translations $translations   the translations to be imported to this translation-set.
param: string       $desired_status 'current', 'waiting' or 'fuzzy'.

waiting_count()   X-Ref
Retrieves the number of waiting translations.

return: int Number of waiting translations.

untranslated_count()   X-Ref
Retrieves the number of untranslated originals.

return: int Number of untranslated originals.

fuzzy_count()   X-Ref
Retrieves the number of fuzzy translations.

return: int Number of fuzzy translations.

current_count()   X-Ref
Retrieves the number of current translations.

return: int Number of current translations.

warnings_count()   X-Ref
Retrieves the number of translations with warnings.

return: int Number of translations with warnings.

all_count()   X-Ref
Retrieves the number of all originals.

return: int Number of all originals.

update_status_breakdown()   X-Ref
Populates the count properties.


copy_translations_from( $source_translation_set_id )   X-Ref
Copies translations from a translation set to the current one

This function doesn't merge then, just copies unconditionally. If a translation already exists, it will be duplicated.
When copying translations from another project, it will search to find the original first.

percent_translated()   X-Ref
No description

last_modified()   X-Ref
Retrieves the last modified date of a translation in this translation set.

return: string|false The last modified date on success, false on failure.
since: 1.0.0

delete()   X-Ref
Deletes a translation set and all of its translations and glossaries.

return: bool
since: 2.0.0

after_create()   X-Ref
Executes after creating a translation set.

return: bool
since: 3.0.0

after_save( $translation_set_before )   X-Ref
Executes after saving a translation set.

return: bool
since: 3.0.0
param: GP_Translation_Set $translation_set_before Translation set before the update.

after_delete()   X-Ref
Executes after deleting a translation set.

return: bool
since: 3.0.0



Generated: Sat Apr 27 01:01:04 2024 Cross-referenced by PHPXref 0.7.1