Difference between revisions of "Define Languages"

From Phoenix Cart User Guide
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<span class="btn-grey"><historylink type="back">&#129032; Back</historylink></span>
+
<div class="btn btn-grey btn-back">{{#fas:arrow-left}} Back</div> <div class="btn btn-grey btn-admin">{{#fas:cog}} Administration</div>
<span class="btn-grey" style="color:#0088dd;">'''[[ADMINISTRATION|&#x1F809; ADMINISTRATION]]'''</span>
 
 
<hr>
 
<hr>
From admin go to '''Tools &rarr; Define Languages''' to see this:
+
From admin go to [[File:adminnavbartools.png|link=]] '''Tools &rarr; Define Languages''' to see this:
 
<div class="mainpage_box">
 
<div class="mainpage_box">
 
[[File:toolsdefinelanguages.png|link=|1500px]]
 
[[File:toolsdefinelanguages.png|link=|1500px]]
Line 8: Line 7:
  
  
*<big>'''ABOUT LANGUAGE FILES'''</big>
+
<big>'''ABOUT LANGUAGE FILES'''</big>
  
Other Language Packs are available to download - currently Spanish, German, Dutch and Russian - the links to find them on GitHub are shown in the '''README''' file in the Phoenix download - download and install now if required.
+
CE Phoenix is English by default but other Language Packs are available to download - the links to find them are shown in the '''README''' file in the CE Phoenix download - download and install now if required. These Language Packs are independently maintained by volunteers so contact the maintainer if you need support for them.
  
Changes to language files can be made to localise and personalise the shop to suit you.
+
Changes to the text shown in the shop can easily be made to localise and personalise the shop to suit you.
  
 
Let's first explain a little about the basic working mechanics of Phoenix.
 
Let's first explain a little about the basic working mechanics of Phoenix.
  
In your browser go to your website, look in the page footer and click the '''Privacy & Cookie Policy''' link.
+
Using a new installation and the main page (home page) as an example, in your browser go to your website to see similar to this:
  
This will open the page - you will see that this page is generated by the file '''privacy.php''' - this is shown in your browser address bar - the file name is '''privacy''' and the file type extension is '''.php'''.
+
<div class="mainpage_box">
 +
[[File:shop.jpg|link=|1500px]]
 +
</div>
 +
 
 +
 
 +
Look in your browser address bar and you will see the page as '''yoursite.com/index.php''' (if it only shows '''yoursite.com''', click the shop logo to refresh the page) so this page is named '''index.php'''.
  
Find this '''privacy''' file in your backup folder/directory on your computer <big>'''([[How to Back Up]])'''</big> - you will find it in the top Phoenix folder/directory - all the main pages that show in your shop will be found here.
+
Note that most everything in CE Phoenix is modularised so a lot of the text showing on the page will be in language files associated with those modules.
  
This file contains all the code to make the page work and you should not normally change anything in it - these type of files are generally referred to as '''core code''' - it is the mechanics so don't touch it unless you know what you're doing or you will break things!
+
As seen in the example, the page could be described in groups of modules.
  
Open '''privacy''' with your file editor e.g. '''<big>[[WinSCP]]</big>'''.
+
So, from the top, there are:
 +
*'''navbar''' modules shown in the navigation bar at the top of the page.
 +
*'''content/header''' modules shown just below the navigation bar.
 +
*'''boxes''' modules shown on the left and right of the central page contents.
 +
*'''content/index''' modules shown in the central page contents specific to this page i.e. index
 +
*'''content/footer''' modules shown at the base of the page.
 +
*'''content/footer-suffix''' modules shown below the footer at the bottom of the page.
  
In the code there will be a reference to the text you see on the page - just a code for each different piece of text.
 
  
<div class="mainpage_box">
+
For example, change the text that shows as '''Welcome on 1078'''.
[[File:Vscprivacy.png|link=|1500px]]
+
 
</div>
+
It is in the central page contents so look in the list for files beginning with '''modules/content/index/'''
 +
 
 +
The specific file for this module is '''modules/content/index/cm_i_title.php'''
 +
 
 +
*Backup any files before making changes.
 +
*Click it to open it to make changes.
 +
*Look in the file for the line - <pre>const MODULE_CONTENT_I_TITLE_PUBLIC_TITLE = 'Welcome on %s';</pre>
 +
 
 +
The '''%s''' is magic code that automatically gets your '''Store Name''' that you entered when installing CE Phoenix, that was entered as '''1078''' in the example. (That can be changed in admin '''Configuration → My Store'''.) Do not change or delete that '''%s''' unless you do not want to show your store name and be sure not to delete one of the single quote marks by mistake or you will break things!
 +
 
 +
For example, change '''Welcome on''' to '''Welcome to''' and click <span class="btn-green">Save</span>.
 +
 
 +
Open the website page again to see your changes or if you still have the page open, refresh or reload the page to see the changes.
 +
 
 +
 
 +
----
 +
 
 +
 
 +
It is important to enter your own text for the pages that customers will use before and after buying, such as the '''Privacy & Cookie Policy''', '''Terms & Conditions''' and '''Shipping & Returns''' pages
 +
 
 +
Links to these pages can be seen in the footer of the shop.
  
In this case there are 4 pieces of text so there are 4 codes:
+
The text for these pages are not changed in Language Files but is changed from admin - go to [[File:adminnavbartools.png|link=]] '''Tools → Info Pages'''
  
*<code>NAVBAR_TITLE</code> for the text that shows in the breadcrumb.
+
For example, go to '''Tools → Info Pages''' and double click '''Privacy & Cookie Policy''' in the list to edit.
*<code>HEADING_TITLE</code> for the text that shows in the page title.
 
*<code>TEXT_INFORMATION</code> for the main text.
 
*<code>IMAGE_BUTTON_CONTINUE</code> for the text that shows in the "Continue" button.
 
  
They are easy to find - these language codes are always written in upper case and if you are using the '''<big>[[WinSCP]]</big>''' file editor they will be show up as white text.
+
Change the text '''Put here your Privacy/Cookie Policies Text.''' to your required text and click <span class="btn-green">Save</span> - done.
  
The codes for each piece of text are '''defined''' in a statement in a corresponding '''language file'''.
 
  
For example, the '''defines''' for the text you see will be found in the language file found in '''includes/languages/english/privacy.php'''.
+
The links to these pages are shown in a module in the footer so, for example, to change the text that shows '''Information''' go to the '''Tools → Define Languages''' list and look for files beginning with '''modules/content/footer/'''
  
Note that the language file has the same name as the corresponding main page file.
+
The specific file for this module is '''modules/content/footer/cm_footer_information_links.php'''
  
You can find and open this language file from admin go to '''Tools → Define Languages'''
+
Click it to edit.
*Look for '''privacy.php''' in the list.
 
*Click to open it and look for the '''defines''' - in this case there will be 3 '''defines''' showing as
 
<pre>define('NAVBAR_TITLE', 'Privacy Notice');
 
define('HEADING_TITLE', 'Privacy Notice');
 
define('TEXT_INFORMATION', 'Put here your Privacy Notice information.');</pre>
 
  
These '''defines''' are for text that shows specifically on the '''privacy''' page - the '''define''' for the text that shows in the "Continue" button is not in this file because it will show on other pages too - it is found in the main '''english.php''' language file.
+
Look in the file for the line - <pre>define('MODULE_CONTENT_FOOTER_INFORMATION_HEADING_TITLE', 'Information');</pre>
  
The text will show between two single quotes e.g. <pre>'Put here your Privacy Notice information.'</pre>
+
Change '''Information''' to your required text and click <span class="btn-green">Save</span>
Now you have the language file open, change the text between the single quotes and click save.
 
  
 
Open the website page again to see your changes or if you still have the page open, refresh or reload the page to see the changes.
 
Open the website page again to see your changes or if you still have the page open, refresh or reload the page to see the changes.
  
Only ever change the text between the quotes - be sure not to delete one of the quotes by mistake or you will break things!.
+
The text that shows '''Privacy & Cookie Policy''' can be changed in the same file.
  
Just about every page and module in Phoenix will work this way and have it's own corresponding language file.
+
Look in the file for the line -
 +
<pre> 'privacy.php' => 'Privacy &amp; Cookie Policy',</pre>
  
The exceptions are the main language files named '''english.php''', there is one for the admin and one for the shop, which control text for many different pages.
+
Change '''Privacy &amp; Cookie Policy''' to your required text and click <span class="btn-green">Save</span>
  
All of the text can be changed in those '''define''' statements to personalise the text or messages displayed.
 
  
So remember - you can change anything in a language file define statement between those two quotes.
+
----
  
IMPORTANT: If you enter any more quotes in your text, you must use a backslash before the quote e.g. '''don\'t''' or you will confuse the system and break things!
 
  
<hr>
+
Alternatively, text can be changed in a language file by editing the file on your server or by editing a language file in your backup directory and uploading to overwrite the file on your server.
  
 +
Just about every page and module in CE Phoenix will work this way and have it's own corresponding language file.
  
Users most commonly want to change the following:
+
Have a good look in the list, explore and open the files to have a look - as long as you don't change anything, you can't break anything.
  
*'''Catalog''' in the breadcrumb -  '''Tools → Define Languages''' and look for '''english.php'''
+
The exceptions are the main language files named '''english.php''', there is one for the admin and one for the shop, which control text for many different pages.
*Text on the front main page -  '''Tools → Define Languages''' and look for '''modules/content/index/cm_i_title.php''' and/or '''modules/content/index/cm_i_customer_greeting.php'''
 
*Text on shop information pages - '''Tools → Define Languages''' and look for '''privacy.php''', '''conditions.php''' and '''shipping.php'''.
 
  
Phoenix is modular meaning some pages are comprised of different modules. In this case the language define will be found in the language file for the module and not for the page as in the above example - '''modules/content/index/cm_i_title.php'''. This can make it difficult to find them but to find the language files to change text see - <big>'''[[How to Change Text]]'''</big>
 
  
 +
IMPORTANT: If you enter any more quotes in your text, you must use a backslash before the quote e.g. '''don\'t''' or you will break things!
 +
CE Phoenix is modular meaning some pages are comprised of different modules. In this case the language define will be found in the language file for the module and not for the page. This can make it difficult to find them but to find the language files to change text see - <big>'''[[How to Change Text]]'''</big>
  
  

Latest revision as of 07:20, 15 May 2021

Back
Administration

From admin go to Adminnavbartools.png Tools → Define Languages to see this:

Toolsdefinelanguages.png


ABOUT LANGUAGE FILES

CE Phoenix is English by default but other Language Packs are available to download - the links to find them are shown in the README file in the CE Phoenix download - download and install now if required. These Language Packs are independently maintained by volunteers so contact the maintainer if you need support for them.

Changes to the text shown in the shop can easily be made to localise and personalise the shop to suit you.

Let's first explain a little about the basic working mechanics of Phoenix.

Using a new installation and the main page (home page) as an example, in your browser go to your website to see similar to this:

Shop.jpg


Look in your browser address bar and you will see the page as yoursite.com/index.php (if it only shows yoursite.com, click the shop logo to refresh the page) so this page is named index.php.

Note that most everything in CE Phoenix is modularised so a lot of the text showing on the page will be in language files associated with those modules.

As seen in the example, the page could be described in groups of modules.

So, from the top, there are:

  • navbar modules shown in the navigation bar at the top of the page.
  • content/header modules shown just below the navigation bar.
  • boxes modules shown on the left and right of the central page contents.
  • content/index modules shown in the central page contents specific to this page i.e. index
  • content/footer modules shown at the base of the page.
  • content/footer-suffix modules shown below the footer at the bottom of the page.


For example, change the text that shows as Welcome on 1078.

It is in the central page contents so look in the list for files beginning with modules/content/index/

The specific file for this module is modules/content/index/cm_i_title.php

  • Backup any files before making changes.
  • Click it to open it to make changes.
  • Look in the file for the line -
    const MODULE_CONTENT_I_TITLE_PUBLIC_TITLE = 'Welcome on %s';

The %s is magic code that automatically gets your Store Name that you entered when installing CE Phoenix, that was entered as 1078 in the example. (That can be changed in admin Configuration → My Store.) Do not change or delete that %s unless you do not want to show your store name and be sure not to delete one of the single quote marks by mistake or you will break things!

For example, change Welcome on to Welcome to and click Save.

Open the website page again to see your changes or if you still have the page open, refresh or reload the page to see the changes.




It is important to enter your own text for the pages that customers will use before and after buying, such as the Privacy & Cookie Policy, Terms & Conditions and Shipping & Returns pages

Links to these pages can be seen in the footer of the shop.

The text for these pages are not changed in Language Files but is changed from admin - go to Adminnavbartools.png Tools → Info Pages

For example, go to Tools → Info Pages and double click Privacy & Cookie Policy in the list to edit.

Change the text Put here your Privacy/Cookie Policies Text. to your required text and click Save - done.


The links to these pages are shown in a module in the footer so, for example, to change the text that shows Information go to the Tools → Define Languages list and look for files beginning with modules/content/footer/

The specific file for this module is modules/content/footer/cm_footer_information_links.php

Click it to edit.

Look in the file for the line -

define('MODULE_CONTENT_FOOTER_INFORMATION_HEADING_TITLE', 'Information');

Change Information to your required text and click Save

Open the website page again to see your changes or if you still have the page open, refresh or reload the page to see the changes.

The text that shows Privacy & Cookie Policy can be changed in the same file.

Look in the file for the line -

 'privacy.php' => 'Privacy & Cookie Policy',

Change Privacy & Cookie Policy to your required text and click Save




Alternatively, text can be changed in a language file by editing the file on your server or by editing a language file in your backup directory and uploading to overwrite the file on your server.

Just about every page and module in CE Phoenix will work this way and have it's own corresponding language file.

Have a good look in the list, explore and open the files to have a look - as long as you don't change anything, you can't break anything.

The exceptions are the main language files named english.php, there is one for the admin and one for the shop, which control text for many different pages.


IMPORTANT: If you enter any more quotes in your text, you must use a backslash before the quote e.g. don\'t or you will break things! CE Phoenix is modular meaning some pages are comprised of different modules. In this case the language define will be found in the language file for the module and not for the page. This can make it difficult to find them but to find the language files to change text see - How to Change Text



Phoenix Cart User Guide, like CE Phoenix Cart, is free to use but is maintained by unpaid volunteers.

Code references are licensed under a Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales License.
All other content is the reserved Intellectual Property and Copyright of phoenixcart.org