Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import terms 3 and 4 into Google drive ready for translation #64

Open
andytgeezer opened this issue Jun 3, 2014 · 24 comments
Open

Import terms 3 and 4 into Google drive ready for translation #64

andytgeezer opened this issue Jun 3, 2014 · 24 comments
Assignees

Comments

@andytgeezer
Copy link

I'm happy to do this (I have lots of time on my hands at the moment) just let me know what needs doing. I intend to amass an army of translators for this. Mwahahahaha

@lewtds
Copy link
Contributor

lewtds commented Jun 3, 2014

The instruction for importing the lessions into Google Docs is surprisingly complicated. When you have time, call me over Hangout and I'll show you.

@andytgeezer
Copy link
Author

Ready when you are my man

@lewtds
Copy link
Contributor

lewtds commented Jun 3, 2014

OK. First, you'll have to install the Translate Toolkit by running these commands (assuming ur on a Mac and have Homebrew installed):

$ brew install python   # to get pip
$ pip install translate-toolkit

Check that you can call txt2po and po2csv in the terminal. Then get the latest version of the CodeClub curriculum (not the one in our repo, it's outdated). For each lesson, find the .md file containing the lesson and run these commands to convert it into a .csv file (a primitive Excel file):

$ txt2po <lesson>.md <lesson>.po
$ po2csv <lesson>.po <lesson>.csv

Navigate to the corresponding folder on Google Drive for that lesson and upload the .csv file. Now, for ease of translation, open it then widen the source and target columns. Also select these two columns then turn on Format > Wrap Text in the menubar.

Hope that'll help.

@andytgeezer
Copy link
Author

Great instructions. I'm on the case now

@andytgeezer
Copy link
Author

Dang - I'm having a look in the CCWorld github at the lessons and they don't have .md files in them. https://github.com/CodeClub/CodeClubWorld-Projects/tree/gh-pages/en-GB

Have I missed something?

@andytgeezer
Copy link
Author

Ignore me! I've found them! https://github.com/CodeClub/webdev-curriculum

@andytgeezer
Copy link
Author

I see what you mean by complicated. Here's my latest error.

Traceback (most recent call last):
  File "/usr/local/bin/txt2po", line 24, in <module>
    from translate.convert import txt2po
ImportError: cannot import name txt2po

I ran all the first bits, imported the repo locally and done this

$ txt2po /Users/apple/Documents/Code Club Vietnam/webdev-curriculum/en-GB/01 The Web.md /Users/apple/Documents/Code Club Vietnam/webdev-curriculum/en-GB/01 The Web.po

@andytgeezer
Copy link
Author

OK - Now I've learnt how to actually use Terminal. I'm in the right directory...

Still getting an error though

$ txt2po "01 The Web.md" "01 The Web.po"
Traceback (most recent call last):
  File "/usr/local/bin/txt2po", line 24, in <module>
    from translate.convert import txt2po
ImportError: cannot import name txt2po

@lewtds
Copy link
Contributor

lewtds commented Jun 4, 2014

Hmm. Looks like brew installs its own version of Python (together with pip and its own set of libraries) whilst and /usr/local/bin/txt2po is using the system version (hence cannot import the txt2po name).

Try removing the brew Python version by brew uninstall python and run this command to install pip for system python:

sudo easy_install -U pip

@andytgeezer
Copy link
Author

Done. New error

$ txt2po "01 The Web.md" "01 The Web.po"
-bash: /usr/local/bin/txt2po: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

@lewtds
Copy link
Contributor

lewtds commented Jun 4, 2014

Haha, this is so messed up. OK, I'll run through on my own machine and upload the csv files somewhere you can access.

@andytgeezer
Copy link
Author

ooooooh. I just typed in

"install python"

@andytgeezer
Copy link
Author

now I've run the command and voila! No error. No idea where the .po file is though...

@lewtds
Copy link
Contributor

lewtds commented Jun 4, 2014

It should be in the same directory that you run the command from. Try running ls (list) to see the list of files in the current directory.

@andytgeezer
Copy link
Author

oh bollocks. That didn't actually work either.

$ txt2po "01 The Web.md" "01 The Web.po
txt2po "01 The Web.md" "01 The Web.po
-bash: /usr/local/bin/txt2po: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

@andytgeezer
Copy link
Author

give me another half hour. I'll try and figure this one out and won't bother you too much I promise!

@andytgeezer
Copy link
Author

Alright I give up. Life is too short for this! Want to take over my computer? If you install all the stuff, I'll run through the donkey work

@lewtds
Copy link
Contributor

lewtds commented Jun 4, 2014

I've just checked on my virtual Mac OS X machine. Translate Toolkit is at fault, not you. Anw, here man: https://dl.dropboxusercontent.com/u/20007163/csv.zip

@andytgeezer
Copy link
Author

OK Term 3 is now good to go on drive. Can you work your magic on Term 4 when you get a moment.

@lewtds
Copy link
Contributor

lewtds commented Jun 4, 2014

Here, my man: https://dl.dropboxusercontent.com/u/20007163/term4csv.zip.

Also, could you tweak the spreadsheets like I said in a previous comment, #64 (comment), so that they look more like this: https://docs.google.com/spreadsheets/d/11lzUbMgI20Knm0lUzP-ckhGMYRtu7jqlNxXKQjy11qE/edit#gid=2096598981?

@andytgeezer
Copy link
Author

Yup I'll tweak and upload this lot. Thanks for the converts. Don't need
anything but the csv in there I presume? No need for images or anything
else as the .csv will only reference the images once it's on github anyway
right?

On 4 June 2014 23:34, Trung Ngo [email protected] wrote:

Here, my man: https://dl.dropboxusercontent.com/u/20007163/term4csv.zip.

Could you tweak the spreadsheets like I said in a previous comment, #64
(comment)
#64 (comment),
so that they look more like this:
https://docs.google.com/spreadsheets/d/11lzUbMgI20Knm0lUzP-ckhGMYRtu7jqlNxXKQjy11qE/edit#gid=2096598981
?


Reply to this email directly or view it on GitHub
#64 (comment)
.

@lewtds
Copy link
Contributor

lewtds commented Jun 4, 2014

Exactly. The translators can use the rendered version here for reference.

@andytgeezer
Copy link
Author

What about the Volunteer resources and worksheets from term 4? There's an
.md in there

On 5 June 2014 00:27, Trung Ngo [email protected] wrote:

here

@andytgeezer
Copy link
Author

All imported and formatted. If you get a chance can you do the volunteer resource in term 4 and then we can close this issue and I can start getting folk onto the translations :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants