GettextTranslator.Dashboard.TranslationStore (gettext_translator v0.2.0)
View SourceIn-memory store for translation entries using ETS. This module manages the storage and retrieval of translations for the dashboard.
Summary
Functions
Returns a specification to start this module under a supervisor.
Creates a changelog entry for a translation.
Returns translations filtered by criteria.
Gets a specific translation by ID.
Returns all translations.
Scans the gettext directories and loads all translations into memory. Also loads associated changelog files.
Saves changelog entries to their corresponding files.
Starts the translation store.
Updates the status of a changelog entry.
Updates a translation entry in the ETS store.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Creates a changelog entry for a translation.
Returns translations filtered by criteria.
Examples
# Get all Spanish translations
TranslationStore.filter_translations(%{language_code: "es"})
# Get all pending translations
TranslationStore.filter_translations(%{status: :pending})
# Get all pending Spanish translations
TranslationStore.filter_translations(%{status: :pending, language_code: "es"})
Gets a specific translation by ID.
Returns all translations.
Scans the gettext directories and loads all translations into memory. Also loads associated changelog files.
Saves changelog entries to their corresponding files.
Starts the translation store.
Updates the status of a changelog entry.
Updates a translation entry in the ETS store.
Parameters
id
- The ID of the translation to updateparams
- A map of attributes to update
Examples
# Update a translation with new text
TranslationStore.update_translation("abc123", %{
translation: "New translation text",
status: :modified
})
# Approve a translation
TranslationStore.update_translation("abc123", %{status: :translated})