Can you share the same language file in both the shop and admin?

Open to all! Ask other shopowners for help.
Post Reply
ArtcoInc
Contributor
Posts: 119
Joined: Fri Oct 25, 2019 4:19 pm
Phoenix Version: v1.0.3.0
Has thanked: 86 times
Been thanked: 17 times

Can you share the same language file in both the shop and admin?

Post by ArtcoInc »

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


Join The Code Co-op to get access to your library in the Code Co-op Forum
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?

Post by Omar_one »

ArtcoInc 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
try this
- 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');
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Can you share the same language file in both the shop and admin?

Post by burt »

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...
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply