How to get list of translatable messages - command-line

I know how to translate a natural language message into the user's language using gettext.
But now I am wondering how to obtain a list of all translatable messages in a given domain.
I have obtained a raw result with something like this:
strings /usr/share/locale/${LANG:0:2}/LC_MESSAGES/$DOMAIN.mo
but I am looking for a neater solution.

The xgettext program extracts translatable strings from .po files, which are the source files for the .mo files found in /usr/share/locale. These .po files should be included in the source distribution of the package for which you want to translate messages.
If you need to work with .mo files, you can translate them back to .po with msgunfmt.

Related

Does Mail::Box::Manager handle Qmail maildir format?

It's not obvious which format this module supports. No mention of 'qmail' nor 'maildir'.
http://search.cpan.org/~markov/Mail-Box-2.120/lib/Mail/Box/Manager.pod
It has functions to move between folders, which sounds like maildir, but then it also hints that it encapsulates Mail::Box::Mbox, which sounds like the single file mbox format.
Here is a description of maildir format: http://wiki.dovecot.org/MailboxFormat/Maildir, and description of both: http://www.postfix.org/virtual.8.html
http://search.cpan.org/~markov/Mail-Box-2.120/lib/Mail/Box-Overview.pod
Each folder maintains a list of messages. Much effort is made to hide differences between folder types and kinds of messages. Your program can be used for MBOX, MH, Maildir, and POP3 folders with no change at all (as long as you stick to the rules).

Extracting file names from an online data server in Matlab

I am trying to write a script that will allow me to download numerous (1000s) of data files from a data server (e.g, http://hydro1.sci.gsfc.nasa.gov/thredds/catalog/GLDAS_NOAH10SUBP_3H/2011/345/). Unfortunately, the names of the files in each directory are not formatted in a similar way (the time that they were created were appended to the end of the file name). I need to be able to specify the file name to subset the data (I have a special tool for these data types) and download it. I cannot find a function in matlab that will extract the file names.
I have looked at URLREAD, but it downloads everything including html code.
Thanks for your help!
You can easily parse the link.
x=urlread(url)
links=regexp(x,'<a href=''([^>]+)''>','tokens')
Reads every link, you have to filter all unwanted links.
For example this gets all grb files:
a=regexp(x,'<a href=''([^>]+.grb)''>','tokens')

Concatenate content of TAGS files from different directories

I'm referring to TAGS file generated by ctags or etags in order to have some code navigation in Emacs with M-..
The typical project looks like this:
Large standard library (more than 100 files, but rarely updated).
Project-specific library (updated on the daily basis).
I would like the project to be able to use two (or maybe more TAGS files), but regenerate only the portion of them, only the ones used inside the particular project. How would I approach this problem?
etags --help:
-i FILE, --include=FILE
Include a note in tag file indicating that, when searching for
a tag, one should also consult the tags file FILE after
checking the current file.

Easy way to get source files from doxygen documentation?

I have found the source for a game that I am interested in modifying, and it's in the form of doxygen "documentation".
Under "files" I get html files with names not related to the cpp and h files, and also line numbers.
I was wondering if there is a way to convert the doxygen documentation into regular cpp and h files.
How many files are there? If not too many, a manual copy-paste perhaps...
html2text is a python program that is pretty good at converting html to, well, text.

Create Numbers file and open it with Numbers on iPad

I would like to do a task that is quite simple on other OS, but it is not so trivial on iOS. Namely, I want to create file and open it in Numbers.
I can preview the file with UIDocumentInteractionController and then offer it to user that he/she opens it.
THis seems to me quite a reasonable solution. However, I need to offer proper file format. I suppose CSV and XLS would be reasonable to implement and it would most probably work, but I would still like to do it in native Numbers format if possible. However, I can't find any info about this file format.
Basically, this task is about exporting data to another app and then working further with them.
I don't know of a library that can create native Numbers files. There are hoewever some libraries that allow creating XLS files. Since Numbers fully supports XLS, this is probably the way to go.
There is a comercial library available that might work on the iPhone (costs $200): http://www.libxl.com/
As for free XLS libraries, I only know xlwt, a Python module. You could set up a webservice that creates an XLS file for your app, using xlwt on the server side.
If you want to pass information to Numbers, you can probably also use CSV files. If you use CSV files, you must be aware of some things. There are two kinds of CSV files: the comma separated version (used in english speaking countries) and the semicolon separated (used in continental europe).
The comma separated CSV files look for example like this:
"ID","First Name","Last Name","Salary"
1,"John","Malkovich",3400.20
2,"Fred","Astaire",2000.60
The second kind of CSV files are semicolon separated and use a comma as decimal mark. They look like this:
"ID";"First Name";"Last Name";"Salary"
1;"John";"Malkovich";3400,20
2;"Fred";"Astaire";2000,60
On the Macintosh, Numbers expects a different format depending on the Region setting. If you have your Region set to the US, it will expect the first kind. If you choose Germany, it will expect the second kind.
I don't know what kind of files Numbers on the iPad expects.
Another alternative would be using copy and paste. Try to copy tab separated text into the clipboard.
I hope this may help you. I've contacted libxl team and they responded with the link to the demo version of their iPhone library: http://www.libxl.com/download/libxl-iphone.zip