Skip to content

Callback not working with Phonegap + Onsen UI #101

Description

@qroft

I am developing a hybrid app with Phonegap and Onsen UI.
My console shows me that the language file has been correctly loaded, but the localization does not appear.
After several tries, i used the example with the callback from this Github repo together with a simple alert AND a console.log - but nothing happens.

This is my code so far:

var opts = { language: "de", pathPrefix: "/js", skipLanguage: "en-US" }; opts.callback = function(data, defaultCallback) { data.message = "Optional call back works."; $("[data-localize]").css({color: "#FF8833"}); defaultCallback(data); alert("this is an alert for the callback"); console.log("the callback console logger."); } $("[data-localize]").localize("lang", opts)

I have a CSP Meta-Tag that should allow everything (also load local JSON files, afaik).
It looks like this:
` meta http-equiv="Content-Security-Policy" content="
default-src 'unsafe-eval' 'unsafe-inline' *;
script-src 'self' 'unsafe-inline' 'unsafe-eval' *;
worker-src blob:;
style-src 'self' 'unsafe-inline' *;
img-src 'self' 'unsafe-inline' 'unsafe-eval' *"

I am sure that i am missing some privileges somewhere, but i am not able to find the error.`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions