AdvancedCustomFields / AdvancedCustomFields/acf

Load textdomain doesn't load the right file

Open
#656 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

The function acf_load_textdomain( $domain = 'acf' ) (at l10n.php file) doesn't load the right file from the WordPress languages directory.

I will use as an example the locale en-ES:

This value of $mofile = $domain . '-' . $locale . '.mo'; results in acf-es_ES.mo but the right file name is advanced-custom-fields-es_ES.mo

Then the .mo file from plugin lang folder is loaded

The result is that translations made by the community are not being used, but local versions that are obsolete.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in l10n.php at acf_load_textdomain() and inspect how the WordPress languages directory and the plugin language folder are searched. Verify that the WordPress community translation filename is selected for the locale, while the plugin fallback still works; done means the current community translation is loaded instead of an obsolete local copy.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
localization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.