[wp-trac] [WordPress Trac] #49625: load_theme_textdomain() opens local files without domain in their name

WordPress Trac noreply at wordpress.org
Wed Mar 11 20:00:57 UTC 2020


#49625: load_theme_textdomain() opens local files without domain in their name
--------------------------+----------------------
 Reporter:  marekdedic    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  I18N          |     Version:
 Severity:  normal        |  Resolution:  wontfix
 Keywords:                |     Focuses:
--------------------------+----------------------

Comment (by SergeyBiryukov):

 Hi there, thanks for the ticket!

 Replying to [ticket:49625 marekdedic]:
 > Looking at the code, I think the issue was introduced in [37414]

 As noted above, while [37414] rearranged some logic, loading `$locale.mo`
 instead of `{$domain}-{$locale}.mo` from the theme's directory is not new,
 it works this way since the introduction in [1808].

 Some history:
 * [1808]
 * [9212] / #6951
 * [22346] / #18960

 This is reflected in
 [https://developer.wordpress.org/reference/functions/load_theme_textdomain/
 load_theme_textdomain()] description:
 > If the current locale exists as a .mo file in the theme's root
 directory, it will be included in the translated strings by the `$domain`.
 >
 > The .mo files must be named based on the locale exactly.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49625#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list