# `GettextTranslator.Util.PathHelper`
[🔗](https://github.com/marmend-company/gettext_translator/blob/main/lib/gettext_translator/util/path_helper.ex#L1)

Helper functions for working with PO and changelog file paths.

# `changelog_path_for_po`

Gets the changelog path corresponding to a PO file.

## Examples

    iex> changelog_path_for_po("priv/gettext/uk/LC_MESSAGES/default.po", :my_app)
    "/path/to/my_app/priv/translation_changelog/uk_default_changelog.json"

# `ensure_changelog_dir`

Ensures the translation_changelog directory exists.

## Examples

    iex> ensure_changelog_dir(:my_app)
    :ok

# `extract_domain`

Extracts the domain from a PO file path.

## Examples

    iex> extract_domain("priv/gettext/uk/LC_MESSAGES/default.po")
    "default"

# `extract_language_code`

Extracts the language code from a PO file path.

## Examples

    iex> extract_language_code("priv/gettext/uk/LC_MESSAGES/default.po")
    "uk"

# `gettext_dir`

Returns the appropriate gettext directory path.

## Examples

    iex> gettext_dir(:my_app)
    "/path/to/my_app/priv/gettext"

# `po_path_for_changelog`

Gets the source PO file path from a changelog path.

## Examples

    iex> po_path_for_changelog("priv/translation_changelog/uk_default_changelog.json", :my_app)
    "/path/to/my_app/priv/gettext/uk/LC_MESSAGES/default.po"

# `translation_changelog_dir`

Returns the appropriate translation changelog directory path.

## Examples

    iex> translation_changelog_dir(:my_app)
    "/path/to/my_app/priv/translation_changelog"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
