2

I have read the best way to edit the top links is to edit the local.xml such as

<reference name="top.links">
        <action method="addLink" translate="label title"><label>Sign Up</label><url>customer/account/create</url><title>Sign Up</title><prepare>true</prepare><urlParams/><position>101</position><liParams>id="link-sign-up"</liParams>
        <aParams>
            <class>top-links-link</class>
        </aParams>
        </action>
    </reference>

The issue here though is that the URL can not be translated eg say I wanted

English URL - /register

German URL - /registrieren

Spanish URL - /registro

What would be the best approach to get this?

3
  • there are methods to translate the word "register" to each language, but do u have customized enough so there is an action for each related language. Default controller will not recognize the translated url.
    – MTM
    Commented Aug 28, 2014 at 15:25
  • Its not so much translating the text its translating the URL that is the issue
    – Goose84
    Commented Aug 28, 2014 at 15:49
  • what you wanted requires lot much customization.
    – MTM
    Commented Aug 28, 2014 at 15:51

2 Answers 2

4

Anna asked me to add some detailed information to this question. As she already said, I've created an extension to achieve the translation of the complete url. At the moment, it is still in development state and isn't officially published on magentocommerce. But it works fine right now.

https://github.com/klein0r/magento-language-routes

Technically, it adds an additional router, which inherits the standard router. Before the route is matched, the different parts (route, controller, action) are translated by using a database table. After that, the original controller will be used. You can store a different translation for each store view.

Additionally, the core_url model was rewritten. This was required, to translate all requested URLs before they will be delivered to the frontend.

All translations can be managed in the backend - without any programming skills or modifying any config.xml files.

This means, that the extension works with every custom url or controller out of the box. Even with third party extensions.

Feel free to contact me in case of any issues.

0
1

Actually I cannot provide the full detailed answer but: At least you need to create a Router to match the new translation strings.

Matthias created an extension "Magento Language Routes" for this a frew days ago:

Features

Translate all URLs for each store (e.g. /customer/account/create -> /kunde/konto/erstellen)

Easy translation without development skills by using the backend Translate third party extensions out of the box

Ability to translate URLs to CMS pages, too

Extension uses the Magento Cache to avoid performance issues

Manage permissions for translations by roles

Old URLs are still working (even if they translated)

https://github.com/klein0r/magento-language-routes

I know that this is not a very detailed technical answer, but that might also be a bit too much here i guess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.