The way that everyone knows
In the "good old days" of early Phoenix, if you wanted to make text changes in (eg) /includes/languages/english/account.php or any other language file you would do this in one of two ways;
1. FTP in, download the file, make your changes, upload the file
or
2. Use the admin/define_languages.php to make the changes
#1 is fine.
#2 was removed due to security concerns, so is now defunct
In both cases, it would be possible to lose your changes on an update to a newer Phoenix version, as Core might have changed the file you have already changed.
The template way
The architecture in Phoenix allows language files to be overridden in the template you are using. So, you can copy (eg) /includes/languages/english/account.php to templates/{tpl}/includes/languages/english/account.php and then make changes in that new file.
Upside of this new approach is that the new file inside your template will never get overwritten by Core.
Downside of this new approach is knowing what to do to actually copy the file from one location to another location (where that location might not yet exist);
1. FTP into /includes/languages/english/account.php
2. Download the file and make changes
3. FTP traverse from /english/ down to /languages/ down to /includes/
4. FTP traverse into /templates/ then into the /{tpl}/ you are using.
At this point depending on whether this has been done before...
If it has;
5. FTP traverse into /includes/ then into /languages/ then into /english/
6. Upload the new file.
If it has not;
5. Create /includes/ folder and traverse into it
6. Create /languages/ folder and traverse into it
7. Create /english/ folder and traverse into it
8. Upload file
Not difficult, but not straightforward for someone without much technical experience.
A potential solution
This little package adds in a new link in the admin > tools dropdown called "language explorer"
From there, this should link to a new language_explorer page.
That page should be self-explanatory. If anyone could find a minute to test it, I would be very thankful.
With this new tool, the `hard work` of creating/traversing folders using FTP is gone. FTP still needs to be used to download the file, notepad or whatever to change the file, and FTP to upload the file. So there is still some technical stuff, but it is greatly reduced.
Please let me know your thoughts/idea/comments/suggestions.
I'm all ears and would appreciate anyone taking the time.
Changing Language Files
- burt
- Core Team
- Posts: 4551
- 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
Changing Language Files
You do not have the required permissions to view the files attached to this post.
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.
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Changing Language Files
From a quick run through:
Handy tool, works well with multiple languages. Easy to use as is. Well done!
To make it more user friendly, maybe it could list the language-files in groups, based on where they are loaded?
Maybe also some sort of search function to find the file(s) containing specific strings.
//Daniel
Handy tool, works well with multiple languages. Easy to use as is. Well done!
To make it more user friendly, maybe it could list the language-files in groups, based on where they are loaded?
Maybe also some sort of search function to find the file(s) containing specific strings.
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
- burt
- Core Team
- Posts: 4551
- 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: Changing Language Files
TY for feedback, appreciate you taking the time
If all the language stuff was in the Database, this would make grouping and searching etc super easy. Unfortunately moving to a DB language system would mean a major architecture change...which probably isn't something we'd want to look at right now, but might be a good idea at some point in the future.
There's not much more we can do with file based languages.
If all the language stuff was in the Database, this would make grouping and searching etc super easy. Unfortunately moving to a DB language system would mean a major architecture change...which probably isn't something we'd want to look at right now, but might be a good idea at some point in the future.
There's not much more we can do with file based languages.
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.
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Changing Language Files
We could do that as an add-on. Which I think would really demonstrate the flexibility of CE Phoenix Cart. It seems huge, but I think it could be done smaller than it first seems, entirely as a no-modified-code add-on.
It would require
1. A template so that it doesn't load most of the language files.
2. Implementing something that loads the base language defines from the database.
3. Implementing something that loads page-specific language defines from the database.
4. Implementing a no-op file that defines nothing so that we don't have to remove the existing require statements.
Optionally, it could load module and class language defines from the database, although that would be harder to integrate with other add-ons. Without this, we'd use a mix of methods. The base and page-specific translations would be in the database while the module and class defines would be in files.
Another alternative would be to mix them. If the database entries exist, do not use the files. If the files exist but the database entries do not, load them into the database. Then people could try it out and see how they like it. If it's popular, we could switch core. However, there would be no hurry in doing so, and we could leave the mixing code in for an extended period of time.
The code needed for that last is roughly the same size as the override template, as it could mostly be done in the template's class file. For everything but translations, it could just refer to the parent template.
- burt
- Core Team
- Posts: 4551
- 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: Changing Language Files
It's definitely something to consider, for sure. It would make the system even more flexible than it already is.
In the meantime this little tool might make the process of overriding a lang file a bit more straightforward.
In the meantime this little tool might make the process of overriding a lang file a bit more straightforward.
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.
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
Re: Changing Language Files
Please test this?
You do not have the required permissions to view the files attached to this post.
-
Omar_one
- Senior Contributor
- Posts: 677
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: Changing Language Files
Working as it should. well done
on our shop we are using two addon to editing the language file
one created by @zipurman app.php/addons/free_addon/language_search_edit/
This tool allows you to search all language files within any of your selected languages
and another one allows the shop owner to edit the text on any page in his shop which is located beneath the root directory
I like it because you can Select a language directory - Select a file
on our shop we are using two addon to editing the language file
one created by @zipurman app.php/addons/free_addon/language_search_edit/
This tool allows you to search all language files within any of your selected languages
and another one allows the shop owner to edit the text on any page in his shop which is located beneath the root directory
I like it because you can Select a language directory - Select a file
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
Re: Changing Language Files
Thank you for testing.
Both of those have the same issues associated with the 'old system' - see original post in this topic.
Language Explorer - latest version uses Accordion Drop Down for a better display:
You do not have the required permissions to view the files attached to this post.
-
Omar_one
- Senior Contributor
- Posts: 677
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: Changing Language Files
heatherbell wrote: ↑Sat Mar 22, 2025 5:12 am Both of those have the same issues associated with the 'old system' - see original post in this topic.
I am working on another one
I will check it outheatherbell wrote: ↑Sat Mar 22, 2025 5:12 am Language Explorer - latest version uses Accordion Drop Down for a better display:
Language Explorer v4 - Grouped Accordion.zip
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
Re: Changing Language Files
Language Explorer is all about trying to make it easier for average new user.
This stems from recently having to help a new shop-owner change a Language constant for the first time.
The process of creating the correct folder tree (up to 5 levels!) in /templates/yourTemplate/ before then copying over the language file on the server was difficult enough for me to explain in an e-mail, even more difficult for the new user to do. I know we have lost new users for this reason alone.
Language Explorer does all this with a few clicks.
User can then just securely edit the new file on the server.
To make it easier for new users, so they do not have to find and install an Addon that they will probably not even know exists, this will be an addition to core which is the purpose of the request for testing in this topic.