Git Product home page Git Product logo

Comments (11)

madc avatar madc commented on July 21, 2024

ad. 1) The translate icons are set by Javascript. Do you get any errors in the console?

ad. 2) As far as i remember, this is intended. You need to add the record with the default language first and can then add translations.

from translate.

peterboorsma avatar peterboorsma commented on July 21, 2024

Yes.

lib.js?2ed94ca141:24 Uncaught Error: Syntax error, unrecognized expression: http://stortemelk3.localhost/beheer/editcontent/paginas/1?_locale=enb.error @ lib.js?2ed94ca141:24b.tokenize @ lib.js?2ed94ca141:24b.select @ lib.js?2ed94ca141:24b @ lib.js?2ed94ca141:24find @ lib.js?2ed94ca141:24fa.fn.init @ lib.js?2ed94ca141:24fa @ lib.js?2ed94ca141:14c.show @ lib.js?2ed94ca141:90(anonymous function) @ lib.js?2ed94ca141:90each @ lib.js?2ed94ca141:14each @ lib.js?2ed94ca141:14b @ lib.js?2ed94ca141:90(anonymous function) @ bolt.js?4c21e560ba:8dispatch @ lib.js?2ed94ca141:25q.handle @ lib.js?2ed94ca141:24
Navigated to http://stortemelk3.localhost/beheer/editcontent/paginas/1?_locale=en

from translate.

SahAssar avatar SahAssar commented on July 21, 2024
  1. That's intentional for now. Until you have saved it it does not have anywhere to "save" the translations, (I'll try to work around this in the future to allow records to only be in an non-default locale).
  2. The behavior is changed from setting the items via JS to setting them on the backend via the _locale query string. This is done so that we don't have to write specific js code to load fields (both bolt's own and extension fields) and also because the JS we wrote to load/unload fields was probably the most fragile thing about the 2.0 version simply because it was often fighting with bolt's own JS and the way that bolt's ajax save cycle worked.

Sounds to me like it's working as it should and the lib.js sounds like it might be unrelated since it is not from this extension.

Sorry, missed the part about the translation icons, Could you please post the contenttypes.yml so I can try to reproduce here?

from translate.

peterboorsma avatar peterboorsma commented on July 21, 2024

The main problem is that the translatable fields won't show up so you can't type text per language.

contenttypes.yml.zip

PS
My posted issues are supposed to help you guys out, not to nag. :)

from translate.

SahAssar avatar SahAssar commented on July 21, 2024

@peterboorsma The issue here is just that while fixing a few other things I changed isTranslateable to is_translateable since it better follows bolt's and YAML's rules about key names that way (I thought it was best to fix all the things that has bothered me in one breaking change when I have to bump major versions anyway). I updated the readme, but forgot to mention it in the issue... :(

Just change isTranslateable to is_translateable and it should work :)

Oh, and I'm very thankful for you trying the extension and posting issue when you run into snags! If you need something in real-time you can also ping me on slack/irc. :)

from translate.

peterboorsma avatar peterboorsma commented on July 21, 2024

Yes. I used the old "isTranslatable". Updated them now.

But...
(and I am sorry) the translations aren't stored properly. If you toggle back and forth between the languages the translated fields are not saved.
Is it intentional that the page is refreshed in the browser instead of changing the translatable fields 'ajaxy'? Because that's what's happening.

from translate.

SahAssar avatar SahAssar commented on July 21, 2024

@peterboorsma yeah, it's intentional to refresh the browser instead of doing it ajaxy... That way it will be much more compatible and robust. The old way of doing it ajaxy would be much harder to make compatible with extensions and would require us to write js for loading values into every extension fieldtype.

For me (when testing with your contenttype) it seems like DB query result is getting cached... Could you try updating page with translations a few times and see if your translations appear then? Perhaps local extensions do not get their DB queries results cached which would explain why I didn't see this when writing the code...

from translate.

SahAssar avatar SahAssar commented on July 21, 2024

@peterboorsma Or you should be able to disable the cache by adding database: false to the caching config in config.yml so it looks something like this:

caching:
    config: true
    templates: true
    request: false
    duration: 10
    authenticated: false
    thumbnails: true
    database: false

from translate.

peterboorsma avatar peterboorsma commented on July 21, 2024

I made a copy of my test site on my dev server. Things work fine there so it must be something on my local server. I'll try to figure that out.

from translate.

peterboorsma avatar peterboorsma commented on July 21, 2024

Problem fixed with dev-master (7fa12c) + Bolt 3..0.10

from translate.

SahAssar avatar SahAssar commented on July 21, 2024

Great :)

from translate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.