{"action":"created","issue":{"url":"https://api.github.com/repos/locomotivecms/engine/issues/1091","labels_url":"https://api.github.com/repos/locomotivecms/engine/issues/1091/labels{/name}","comments_url":"https://api.github.com/repos/locomotivecms/engine/issues/1091/comments","events_url":"https://api.github.com/repos/locomotivecms/engine/issues/1091/events","html_url":"https://github.com/locomotivecms/engine/issues/1091","id":120951872,"number":1091,"title":"Editable Elements and internationalization/localization","user":{"login":"CedricLor","id":11865200,"avatar_url":"https://avatars.githubusercontent.com/u/11865200?v=3","gravatar_id":"","url":"https://api.github.com/users/CedricLor","html_url":"https://github.com/CedricLor","followers_url":"https://api.github.com/users/CedricLor/followers","following_url":"https://api.github.com/users/CedricLor/following{/other_user}","gists_url":"https://api.github.com/users/CedricLor/gists{/gist_id}","starred_url":"https://api.github.com/users/CedricLor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CedricLor/subscriptions","organizations_url":"https://api.github.com/users/CedricLor/orgs","repos_url":"https://api.github.com/users/CedricLor/repos","events_url":"https://api.github.com/users/CedricLor/events{/privacy}","received_events_url":"https://api.github.com/users/CedricLor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-08T07:39:21Z","updated_at":"2015-12-10T23:48:58Z","closed_at":null,"body":"I want my index.liquid page to be internationalized/localized. So let's create a new wagon site.\r\n\r\n     wagon init test_site -t bootstrap\r\n\r\nAll the shizzle gets generated.\r\n\r\n**First step**\r\napp/pages/liquid.index looks like that:\r\n\r\n    ---\r\n    title: Home page\r\n    published: true\r\n    handle: home\r\n    ---\r\n    {% extends 'layouts/simple' %}\r\n\r\n    {% block content/main %}\r\n\r\n    <div class=\"row\">\r\n      <div class=\"col-lg-4\">\r\n        {% editable_text first_column %}\r\n          <h2>Heading #1</h2>\r\n          <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>\r\n        {% endeditable_text %}\r\n      </div>\r\n      <div class=\"col-lg-4\">\r\n        {% editable_text second_column %}\r\n          <h2>Heading #2</h2>\r\n          <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>\r\n        {% endeditable_text %}\r\n     </div>\r\n      <div class=\"col-lg-4\">\r\n        {% editable_text third_column %}\r\n          <h2>Heading #3</h2>\r\n          <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.</p>\r\n        {% endeditable_text %}\r\n      </div>\r\n    </div>\r\n\r\n    {% endblock %}\r\n\r\nI run it with a\r\n\r\n     bundle exec wagon serve\r\n\r\nEverything is fine.\r\n\r\nI push it to the Engine with a\r\n\r\n      bundle exec wagon push production -d\r\n\r\nEverything works properly in the Engine.\r\n\r\n**Second step**\r\n\r\nTo localize, I need to create an index.fr.liquid (as well as the underlying simple.fr.liquid and default.fr.liquid) and set the relevant locales in my config/site.yml file. My index.fr.liquid looks like that:\r\n\r\n    ---\r\n    title: Page d’accueil\r\n    published: true\r\n    handle: home\r\n    editable_elements:\r\n        'content/main/first_column': \"Mon texte en français de la première colonne\"\r\n        'content/main/second_column': \"Mon texte en français de la seconde colonne\"\r\n        'content/main/third_column': \"Mon texte en français de la troisième colonne\"\r\n    ---\r\n\r\nIn Wagon, everything works fine (http://localhost:3000 renders the English version and http://localhost:3000/fr renders the French version).\r\n\r\nIn the Engine, I need to push to a new site in order to override the locales (this is fine).\r\nIn the site preview, I can only see my English page, whatever the locale in the URL.\r\nIn the back office, same problem.\r\n\r\n**Third step**\r\n\r\nSo I refactor my index.liquid file to include the editable_elements in the header and make it match with index.fr.liquid and add drops in the body making references to the keys in the editable_elements section.\r\n\r\n    ---\r\n    title: Home page\r\n    published: true\r\n    handle: home\r\n    editable_elements:\r\n        'content/main/first_column': \"My English first column\"\r\n        'content/main/second_column': \"My English second column\"\r\n        'content/main/third_column': \"My English third column\"\r\n    ---\r\n    {% extends 'layouts/simple' %}\r\n\r\n    {% block content/main %}\r\n\r\n        {% editable_text first_column %}\r\n        {% endeditable_text %}\r\n        {% editable_text second_column %}\r\n        {% endeditable_text %}\r\n        {% editable_text third_column %}\r\n        {% endeditable_text %}\r\n\r\n    <div class=\"row\">\r\n      <div class=\"col-lg-4\">\r\n        {{ first_column }}\r\n      </div>\r\n\r\n      <div class=\"col-lg-4\">\r\n        {{ second_column }}\r\n      </div>\r\n\r\n      <div class=\"col-lg-4\">\r\n        {{ third_column }}\r\n      </div>\r\n    </div>\r\n\r\n    {% endblock %}\r\n\r\nHere, in Wagon, everything is broken. Nothing appears in my columns.\r\nIn Engine, in the preview, same thing.\r\nIn the back-office however, in the textareas (where I can modify the editable elements), I can see the relevant texts that have been inserted in the header of the liquid files.\r\n\r\n**Fourth step**\r\n\r\nSo I modify again my index.liquid file to insert in the drops a full path reference to the editable_elements.\r\n\r\n    ---\r\n    title: Home page\r\n    published: true\r\n    handle: home\r\n    editable_elements:\r\n        'content/main/first_column': \"My English first column\"\r\n        'content/main/second_column': \"My English second column\"\r\n        'content/main/third_column': \"My English third column\"\r\n    ---\r\n    {% extends 'layouts/simple' %}\r\n\r\n    {% block content/main %}\r\n\r\n        {% editable_text first_column %}\r\n        {% endeditable_text %}\r\n        {% editable_text second_column %}\r\n        {% endeditable_text %}\r\n        {% editable_text third_column %}\r\n        {% endeditable_text %}\r\n\r\n    <div class=\"row\">\r\n      <div class=\"col-lg-4\">\r\n        {{ page.editable_elements.content.main.first_colum }}\r\n      </div>\r\n\r\n      <div class=\"col-lg-4\">\r\n        {{ page.editable_elements.content.main.second_column }}\r\n      </div>\r\n\r\n      <div class=\"col-lg-4\">\r\n        {{ page.editable_elements.content.main.third_column }}\r\n      </div>\r\n    </div>\r\n\r\n    {% endblock %}\r\n\r\nHere, in Wagon, it works fine (everything is displayed properly).\r\nIn the Engine, in the preview, it works fine. In the back-office, the textareas are populated correctly.\r\nHowever, the live editing is broken.\r\n\r\nAm I missing something?"},"comment":{"url":"https://api.github.com/repos/locomotivecms/engine/issues/comments/163789006","html_url":"https://github.com/locomotivecms/engine/issues/1091#issuecomment-163789006","issue_url":"https://api.github.com/repos/locomotivecms/engine/issues/1091","id":163789006,"user":{"login":"CedricLor","id":11865200,"avatar_url":"https://avatars.githubusercontent.com/u/11865200?v=3","gravatar_id":"","url":"https://api.github.com/users/CedricLor","html_url":"https://github.com/CedricLor","followers_url":"https://api.github.com/users/CedricLor/followers","following_url":"https://api.github.com/users/CedricLor/following{/other_user}","gists_url":"https://api.github.com/users/CedricLor/gists{/gist_id}","starred_url":"https://api.github.com/users/CedricLor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CedricLor/subscriptions","organizations_url":"https://api.github.com/users/CedricLor/orgs","repos_url":"https://api.github.com/users/CedricLor/repos","events_url":"https://api.github.com/users/CedricLor/events{/privacy}","received_events_url":"https://api.github.com/users/CedricLor/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T23:48:58Z","updated_at":"2015-12-10T23:48:58Z","body":"Found a quick fix, unofficial. Check this file out: \r\nhttps://github.com/locomotivecms/liquid/blob/master/lib/liquid/block_body.rb\r\n\r\nReplace line 89 by the following line:\r\n\r\n          unless token.is_a?(Block) && token.blank?\r\n\r\nby the following line:\r\n\r\n          unless token.is_a?(Block) && token.blank? && !(token_output.match(/locomotive-editable-text/))\r\n\r\nNow you can do:\r\n\r\n    editable_elements:\r\n      'content/main/first_column': \"My English first column\"\r\n      'content/main/second_column': \"My English second column\"\r\n      'content/main/third_column': \"My English third column\"\r\n    ---\r\n    {% block content/main %}\r\n        {% editable_text \"First column\", slug: \"first_column\" %}\r\n        {% endeditable_text %}\r\n        {% editable_text \"Second column\", slug: \"second_column\" %}\r\n        {% endeditable_text %}\r\n        {% editable_text \"Third column\", slug: \"third_column\" %}\r\n        {% endeditable_text %} \r\n    {% endblock %}\r\n\r\nas if you had done:\r\n\r\n    # editable_elements:\r\n    #  'content/main/first_column': \"My English first column\"\r\n    #  'content/main/second_column': \"My English second column\"\r\n    #  'content/main/third_column': \"My English third column\"\r\n    ---\r\n    {% block content/main %}\r\n        {% editable_text \"First column\", slug: \"first_column\" %}\r\n            \"My English first column\"\r\n        {% endeditable_text %}\r\n        {% editable_text \"Second column\", slug: \"second_column\" %}\r\n            \"My English second column\"\r\n        {% endeditable_text %}\r\n        {% editable_text \"Third column\", slug: \"third_column\" %}\r\n            \"My English third column\"\r\n        {% endeditable_text %} \r\n    {% endblock %}\r\n\r\nwith live-editing working!!!!\r\n\r\n@did I think this could somehow be factored into steam. I understand that this might have been a bug carried over from the former version."}}