Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthoredward
     

    Hi guys,

    I'm working with Editam at this moment, trying to get a multilingual site to run. I've been editing some source code to get things running how I need them to.

    I have been trying to find something which I need in my layouts.

    Explanation:

    I have the same urls for english and dutch. For example, if I have this url: www.school.com/bachelors in English text, then I also have a Dutch page with the same url: www.school.com/bachelors (with the content div containing Dutch text instead of English). So if a user is in an English page, and wants to go to the Dutch page, then all they need to do is go to this url: www.school.com/nl/bachelors . In other words, all they need to do is add the locale after the base url.

    My problem is that I cannot find a way to create links that will always link to different language at the current url. With the previous example, I would like to have links in the layout that would have, /nl/bachelors and /de/bachelors. And when dutch is chosen, then I would have /en/bachelors and /de/bachelors. So in a way, editam will go to the database, pull out the locales from the table: site_preferences (in this case, nl,en,de) and then create automatic links in the layout that point to each language, no matter in what page/url you are in. It would follow you and add the locale to the beginning of each url that you visit in case you want to change language and be redirected to the same page you are in.

    The work:

    At the moment I've been looking at /include/akelos/lib/AkActionView/helpers/url_helper.php because I can use the function "url_for" . The way I'm using it is like this:

    url_for(array('lang' => 'es')) *for Spanish

    In an existing editag: I added this to get the result on my pages for debugging.

    return $this->_controller->url_helper->url_for(array('lang' => 'es'))

    What I'm hoping is that this will always give me a link, no matter in what page I'm in, that will point to the Spanish language of the same page. So in other words, I should get this:

    www.school.com/es/bachelors , if I was initially in www.school.com/en/bachelors page .

    However, using the url_for function, I instead get the internal url that Editam uses, which is:

    /es/site/show_page?url=%2F instead of /es/bachelors

    How can I get the right links? Adding 'url' => 'example' to the $options array doesn't help.

    My goal is to have an editag, for example called locale_links that will output image links (flags) for each language that is used in editam.

    Thanks!

    •  
      CommentAuthorbermi
     

    Hi Edward,

    What you are looking for is not implemented yet in Editam. But for sure it will be available before 1.0

    The way to implement this is via Editags helpers. There is a similar method at UrlHelper::modify_current_url that will need more testing for supporting Editam url(array) parameter.

    Luckily Editam has snippets and you can add support for this by implementing an es_url snippet with the following code

    <?='/es/'.join('/', $params['url']);?>
    

    then you can call the snippet from using Editags like

    {%= snippet 'es_url' %}
    

    Please feel free add your future suggestions into Editam's trac, and if you are considering implementing some functionality for Editam, you can open a ticket with the feature and assign it to yourself.

    My ideal way for implementing this properly is by keeping track of translations, so we can have the same page with localized slugs.

    I'm surprised to see people getting their hands into Editam considering the CMS market saturation and the lack of documentation and advocacy.

    • CommentAuthoredward
     

    Hi Bermi,

    Thanks for your help. This is my second post on the forum and you've helped me on both occasions.

    I will look into what you have told me and implement it today.

    The reason why I'm getting my hands dirty with Editam is because I like it and I can read and follow the source code quite easily. I don't have much time to build websites and edit the source code, but with Editam I find it quite fast. I also like the way it's heading, from what I read in your website and the irc logs. I like it when it's kept simple.

    Now that you mention it, I would also like to contribute to Editam some time. I'm glad you told me the way you would implement it because I can try it, and submit it when I think it's ready. Although I have never done that, so someone will need to double check.

    I just ask that you guys don't abandon the project and keep up the good work! Just a little thing I want to add: There should be more documention in the apis. Of course, I can read the code myself and find out what things do, but it might save time for a lot of newbies.

    Thanks again. Saludos de holanda!

    p.d. Whenever you have tips on how to implement things, like you did in your reply to my post (with the snippets), I suggest to make it as detailed as possible. Heck, if you would have a page dedicated on listing new features and how they should be implemented, I would certainly spend time on it. In this case for the snippets, I really appreciated that you mentioned it because it also makes it easier for me.

    •  
      CommentAuthorbermi
     

    Edward,

    We will be keeping track of new features and bugs on the trac site. You can see a list of pending tasks including enhancements.

    Feel free to open tickets there for discussing implementation details, I've just created a ticket with detailed information about implementing a translation workflow engine that will allow linking Pages with their correspondent translations.

    I have also prepared two new reports on the trac site. One for pending bugs and another for pending enhancements, hopefully this will make collaboration easier :)