setting up development environment. Language string lost

setting up development environment. Language string lost

by Isaac Marco Blancas -
Number of replies: 8
Picture of Core developers

I'm setting up my development environment for moodlemobile2 following steps in https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2

Everything seems to be working but the language string are not displayed. I attach a screen.

Attachment moodlemobile2.png
Average of ratings: -
In reply to Isaac Marco Blancas

Re: setting up development environment. Language string lost

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Isaac,

please make sure that the language files are built. Inside www/build/lang you should have these files:

https://github.com/moodlehq/moodlemobile-phonegapbuild/tree/master/build/lang

If they aren't there it means there's something wrong with your build process, maybe you miss some dependencies. Run 'npm install', then 'gulp' and check if there's any error shown in the console.

If the files are there then maybe you lack the angular translate libraries. Please run 'bower install' or 'bower update' and make sure you haven't removed any of the libraries needed from index.html:

https://github.com/moodlehq/moodlemobile2/blob/master/www/index.html#L11

Hope this helps!

Dani

In reply to Dani Palou

Re: setting up development environment. Language string lost

by Isaac Marco Blancas -
Picture of Core developers

Thank you Daniel. The files are there but they are empty. ¿?¿?

npm install and gulp seems to run ok. I get this:

(master) isaac.marco@portatil51:/var/www/moodlemobile2$ npm install
npm WARN package.json mm2@1.0.0 No repository field.
npm WARN package.json mm2@1.0.0 No license field.
(master) isaac.marco@portatil51:/var/www/moodlemobile2$ gulp
[20:47:19] Using gulpfile /var/www/moodlemobile2/gulpfile.js
[20:47:19] Starting 'build'...
[20:47:19] Finished 'build' after 34 ms
[20:47:19] Starting 'sass-build'...
[20:47:19] Starting 'lang'...
[20:47:19] Finished 'lang' after 58 ms
[20:47:21] Finished 'sass-build' after 2.86 s
[20:47:21] Starting 'sass'...
[20:47:23] Finished 'sass' after 1.93 s
[20:47:23] Starting 'default'...
[20:47:23] Finished 'default' after 6 μs

When "bower update" everything seems OK. My www/build/lang still are empty.


Those are some errors or wanings reported while reinstalling thinks.

npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.7","npm":"2.11.3"})
npm WARN engine cordova-js@4.0.0: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.7","npm":"2.11.3"})
npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.12.7","npm":"2.11.3"})
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.7","npm":"2.11.3"})
/usr/bin/cordova -> /usr/lib/node_modules/cordova/bin/cordova
npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bundled package wasn't found in unpacked tree
/usr/bin/ionic -> /usr/lib/node_modules/ionic/bin/ionic

(master) isaac.marco@portatil51:/var/www/moodlemobile2$ sudo npm install
npm WARN package.json mm2@1.0.0 No repository field.
npm WARN package.json mm2@1.0.0 No license field.
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.7","npm":"2.11.3"})
npm WARN optional dep failed, continuing fsevents@1.0.2


npm WARN deprecated pangyp@2.3.2: use node-gyp@3+, it does all the things


(master) isaac.marco@portatil51:/var/www/moodlemobile2$ ionic platform add iOS
Updated the hooks directory to have execute permissions
Platform "iOS" not recognized as a core cordova platform. See `cordova platform list`.


Updated the hooks directory to have execute permissions
Fetching plugin "com.phonegap.plugin.statusbar" via npm
Fetching plugin "com.phonegap.plugin.statusbar" via cordova plugins registry
Failed to fetch plugin com.phonegap.plugin.statusbar via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: 404 Not Found: com.phonegap.plugin.statusbar


Fetching plugin "net.tunts.webintent" via cordova plugins registry
Failed to fetch plugin net.tunts.webintent via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: 404 Not Found: net.tunts.webintent


Fetching plugin "ch.ti8m.documenthandler" via npm
Fetching plugin "ch.ti8m.documenthandler" via cordova plugins registry
Failed to fetch plugin ch.ti8m.documenthandler via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: 404 Not Found: ch.ti8m.documenthandler


In reply to Isaac Marco Blancas

Re: setting up development environment. Language string lost

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi again Isaac,

the errors about plugins not found are because those plugins aren't in the cordova plugins registry. To install those you need to run:

ionic plugin add https://github.com/Tunts/WebIntent https://github.com/ti8m/DocumentHandler cordova-plugin-customurlscheme --variable URL_SCHEME=moodlemobile cordova-plugin-statusbar

It's really weird that the files are empty... The gulp task that builds the lang files is handled by npm, so bower shouldn't affect it. Maybe it doesn't have the right permissions to write into the files?


Regards,

Dani

In reply to Dani Palou

Re: setting up development environment. Language string lost

by Isaac Marco Blancas -
Picture of Core developers
The problem persists...

I have deleted my cloned repository. I have repeated all the steps in https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2

No errors found on the installations.

No permissions problems on the www/build/lang/   .

Files on this directory exists but they still are empty.

I'm on Ubuntu 14.04. Some other idea?
In reply to Isaac Marco Blancas

Re: setting up development environment. Language string lost

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Isaac,

you should add some debugging in the gulpfile.js file, starting line 212

For example, before: gulp.src(langpaths) add console.log(langpaths); then run gulp and check the output (in this case, you should see listed there all the language files)

If that's is working fine, you should try to isolate the error in the following lines

Juan

In reply to Isaac Marco Blancas

Re: setting up development environment. Language string lost

by Mohammed Essaid MEZERREG -

I think this is a weird problem that happens when you put two ionic project in the same place (under the same directory) let's say:

-- workspace

    |-- moodlemobile

    |-- anotherionicproject

It happened with me at the beginning when I started working on a custom moodle app, where I put the official mobile app and my custom app under the same directory and I started working, when I install the plugins and platform for the second (custom app) they will be installed out of the app folder, perhaps you can check if the plugins and platforms folder exist in your project or outside of it.

the solution is to put them in separate directories ( I mean parent directories) like:
|__workspace

    |__ moodle

    |     |__ moodlemobile
    |__ Others

    |     |__ anotherionicproject


Hope this will solve your project.

In reply to Isaac Marco Blancas

Re: setting up development environment. Language string lost

by Abner Tellez -

Hi Isaac! How are you? Can you resolved it? I have the same problem

Regards 


Abner Tellez 

In reply to Abner Tellez

Re: setting up development environment. Language string lost

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hello there,

a while ago we detected a problem with language files if your development environment was inside a 'www' folder. This has been fixed in the moodlemobile2 repository. This is the issue:

https://tracker.moodle.org/browse/MOBILE-1680

Can you please check if this was the problem and it works now?

Kind regards,

Dani