Jump to content

Create new language for entire site


Taodi
 Share

Recommended Posts

I'm trying to add Chinese to my site, not only in the language module that controls all the labels and message strings, but also to convert my document pages into Chinese, including homepage, an About-the-Products page, Shipping & Returns, and Contact us. To begin with, creating a new language in Admin/Languages is straightforward. As long as I've translated all the strings in there, and turned the new language ON, the customer can click on the Chinese flag at the top of any page and will see all the labels, etc. in Chinese. Then I go into Admin/Documents and find that I can create a new document and choose Chinese among the language choices, which then presumably associates this new document with Chinese. Evidently, I create a new document for each of the 4 pages I mentioned above, with completely Chinese content that I provide.

 

But this is where the trouble begins. I cannot figure out how to set things up so that when the customer clicks on the Chinese flag, he will now see a totally Chinese site. One problem is that the Admin/Documents/Overview tab will not let me choose more than one Homepage or more than T&Cs. Yet, both the Chinese homepage and the English homepage will need to be identified as homepage if they're going to appear when the customer clicks on homepage (either for Chinese or for English). Similar problem with T&Cs. Also, I find that when I created a Shipping and Returns page in Chinese and activated it (turned it on), a new Chinese link appeared in the bar at the bottom of each page, alongside the pre-existing English document links, whether or not the customer selected Chinese by clicking on the Chinese flag.

 

Does anyone know how to set this up properly? I'm running Cubecart 5.2.4

Link to comment
Share on other sites

Welcome Taodi! Glad to see you made it to the forum.

 

I haven't tried this, but I think this is your solution:

 

"Evidently, I create a new document for each of the 4 pages I mentioned above, with completely Chinese content that I provide."

 

In the list of existing documents, you will have one in the list that is identified as a Homepage. In the right-most column is a white plus-sign in a green circle. Click on this to create a sibling document in a language of your choice.

Link to comment
Share on other sites

Before I work on a complete translation of my site, I find I have another question. What happens regarding translation of the admin/backstore content? Once I’ve added a Chinese translation, if I translate into Chinese all the language strings pertaining to general store content found in Admin/Languages, will that mean that my backstore language will all appear in Chinese? If so, of course, that isn’t real convenient for an administrator whose native language is English.

 

I tested this by modifying a string or two into Chinese and found that, with Chinese turned on, it doesn’t seem to change the backstore content (that is, English still shows as before). Yet with one or two changes it’s a little hard to be sure in as much as I don’t know for sure exactly which string appears where in the many admin pages one can open and work on.

 

Yet, if admin content remains in English even when translated, then that requires me to know which strings are admin content and which are strings that the customer will see. The two often seem to be mixed together in the same string grouping. Specifically, some string groupings seem obviously admin only or customer-view only, while other string groupings seem to have some of each. This presents a little bit of a headache since I can waste time translating admin things that will still show in the backstore as English. Conversely, if I think erroneously that something is Admin language that only shows in the backstore and therefore don’t translate it, then my Chinese customer will see it in English.

 

Cubecart is a well-organized system and I’m sure you’ve got a convenient way through all this, but would appreciate a little help for the novice.

Link to comment
Share on other sites

"What happens regarding translation of the admin/backstore content?"

 

It is true there is no restriction on where a phrase may be used. And I, myself, have used suitable phrases that appear in admin for purposes on the storefront and vice versa.

 

CubeCart works in three languages:

  • the store default as set in the Store Settings
  • the customer may choose to override by selecting a personal choice from the language selector
  • the administrator may override by setting a personal choice in their admin profile (requires a logout - login)

So, your admin profile may have you set to use English, and the store may default to English.

 

If you create Chinese phrases as a child of another language, CubeCart will use un-changed phrases from the parent. But if you create Chinese as an independent language, (I think) missing phrases will be exactly that - no phrase shown at all.

Link to comment
Share on other sites

So, if I understand things correctly, with regard to my question above:

"Yet, if admin content remains in English even when translated, then that requires me to know which strings are admin content and which are strings that the customer will see."

 

.... as I translate the various language strings found in Admin/Languages, it falls upon me, the administrator, to determine which strings are used by the backstore and which strings the customer will see? If this is the case, I'm afraid I'm a bit daunted by the task! As I say, some strings are clearly backstore related, but for many it's not at all clear whether they're backstore or customer view. Practically speaking, how do I get over this hurdle? (I am creating Chinese phrases as a parent of the original English)

Link to comment
Share on other sites

"It falls upon me, the administrator, to determine which strings are used by the backstore and which strings the customer will see?"

 

On the surface, you may think it is the admin's role. That would be true if you, as the store owner, have a special situation or uniqueness about your store where some of the phrases may need a slight change in the wording.

 

But this task, essentially the wholesale creation of a new language file, is a developer's role. It would upon the developer to determine which strings are typically used where. That can be done by looking at the code found in the /classes/ directory, and the HTML found in the /skins/ directory (although the admin side of the store does use a few of the functions in the classes). The admin side of the store has it's own set of code files in the /sources/ and its own admin /skins/ folder.

 

The developer would search through the code (and as a developer, they would have the tools to do this very efficiently) looking for instances of calling the Language class, or using the language array. For example:

Class: $GLOBALS['language']->catalogue['error_review_submit']

The 'error_review_submit' phrase in the catalogue group.

Skin: {$LANG.catalogue.product_doesnt_exist}

The 'product_doesnt_exist' phrase in the catalogue group.

 

Practically speaking, your task is asking more from an Admin than would be expected. You would need to adjust your expectations and approach this as a Developer.

 

As an aside, creating a whole-cloth language file for Chinese (Cantonese, Mandarine, Classical, or Standard), has been on my to-do list for a long time. I would be very interested in collaborating with you (me, the developer, and you, the translator) on this task.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...