I have some duplicate language definitions in both:
/includes/languages/english.php
and
/admin/includes/languages/english.php
If I want to edit these, there is a non-zero chance that I will edit one and not the other. Is there a way that these language definitions could be shared in a single file across both the shop and admin?
(Yes, they could be added in the configurations table in the database, but doesn't that become more difficult if the store in multi-lingual?)
TIA
Can you share the same language file in both the shop and admin?
-
Omar_one
- Senior Contributor
- Posts: 676
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: Can you share the same language file in both the shop and admin?
try thisArtcoInc wrote: ↑Thu Feb 12, 2026 4:53 pm I have some duplicate language definitions in both:
/includes/languages/english.php
and
/admin/includes/languages/english.php
If I want to edit these, there is a non-zero chance that I will edit one and not the other. Is there a way that these language definitions could be shared in a single file across both the shop and admin?
(Yes, they could be added in the configurations table in the database, but doesn't that become more difficult if the store in multi-lingual?)
TIA
- Create a shared file: Create /includes/languages/english/global_definitions.php
- Move your shared defines there
-Link them: In both /includes/languages/english.php and /admin/includes/languages/english.php, add this near the top
Code: Select all
require_once(DIR_FS_CATALOG . 'includes/languages/english/global_definitions.php');- burt
- Core Team
- Posts: 4550
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Can you share the same language file in both the shop and admin?
I wouldn't advise to do so, as you're breaking foundations, which may cause the whole shop to collapse...
The better way would be to simply put a BIG NOTICE at the top (or somewhere) in each file;
// ADMIN SIDE ENGLISH
// SHOP SIDE ENGLISH
to remind you which version you are working on...
The better way would be to simply put a BIG NOTICE at the top (or somewhere) in each file;
// ADMIN SIDE ENGLISH
// SHOP SIDE ENGLISH
to remind you which version you are working on...
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.