AdvancedCustomFields / AdvancedCustomFields/acf

Free version language files domain problem

Open
#571 0 comments 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 language files loading method acf_load_textdomain() isn't loading correctly.

Either it's the Free or Pro version, it first tries to load the translation files from the WP_LANG/plugins folder, and if it fails, it falls back to the provided plugin/lang language files.

The problem is that the function is looking for a $domain = 'acf' only.

  • The Free version language files domain is the plugin slug: advanced-custom-fields-xx_XX.mo
  • The Pro version language files domain is 'acf': acf-xx_XX.mo

So, it never loads the WP.org provided translations, because the plugin is looking for the wrong acf-xx_XX.mo files.

A solution:
If ACF_PRO isn't set, first try to get the wp.org WP_LANG/plugins/advanced-custom-fields-xx_XX.mo file.
Fallback to local provided plugin/lang/acf-xx_XX.mo file.

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 includes/l10n.php at acf_load_textdomain(). Compare the Free and Pro domain names and trace the WP_LANG/plugins lookup before the local plugin/lang fallback. Done means Free uses the advanced-custom-fields-xx_XX.mo domain for the WordPress.org lookup while retaining the local acf-xx_XX.mo fallback.

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
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.