summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Makefile: link -liconv if necessarymingwrofl0r2018-07-181-2/+4
| | | | closes #33
* Makefile: move LDFLAGS into the proper positionrofl0r2018-07-161-2/+2
| | | | | if external libraries are required, they have to be added after the object files that require them.
* Revert "makefile: add LDLIBS to handle -liconv correctly"rofl0r2018-07-161-3/+2
| | | | | | This reverts commit 1a4dc39864ff80c5fb2464b16c4609593c34ae69. The commit breaks compilation on sabotage.
* install.sh: set proper execute permissionsrofl0r2018-07-141-0/+0
|
* makefile: add LDLIBS to handle -liconv correctlyxhe2018-07-141-2/+3
| | | | | | | | | | | | | | The previous commit was done with mingw. And it can not be compiled at first. Gcc told me he can not find libiconv even if i added -liconv into LDFLAGS. https://stackoverflow.com/questions/13249610/how-to-use-ldflags-in-makefile , and i found this article. The original position of LDFLAGS seems to only be considered at the compiling stage. But what we gonna go through is the linking stage, which makes -lxxx in LDFLAGS useless. So i added LDLIBS to the end of line. By the way, -liconv is set by default for compatibility. And mingw now works well with gettext-tiny.
* install: symlink m4 files to $(dataroot)/aclocalxhe2018-07-142-9/+80
| | | | | | | | | | | follow https://github.com/sabotage-linux/gettext-tiny/issues/27. According to @awilfox, GNU gettext will install m4 files to aclocal dir. But gettext-tiny did not. So autoreconf just stops working and complains that it can not find needed macros. Suggested by rofl0r, symlinking all m4 files into $(dataroot)/aclocal is a good idea. Save a little disk space.
* msgfmt: Raise buffer size limitsA. Wilcox2018-07-141-2/+2
| | | | | | | | | | | In the Dzongkha translation of GConf 3.2.6, msgfmt aborts because a line is 4,279 bytes long, while the buffer size is limited to 4,096 bytes. This commit raises the line buffer size to 8,192 bytes, and also doubles the conversion buffer to ensure enough space is still present to do the proper conversions. Resolves #28.
* README: Add LIBINTL=FLAVOR to install commandA. Wilcox2018-07-141-1/+1
| | | | | | | | Without this, libintl will always be compiled for the default NOOP flavour, which does not help when you want =MUSL or =NONE. This tripped us up at Adélie: https://code.foxkit.us/adelie/packages/commit/5d228c9a
* msgfmt: escape '\a' as well as other charactersxhe2018-06-181-0/+3
| | | | | Failed to compile procps pofiles due to msgfmt did not handle '\a' at all. Programs stepped in to abort directly.
* xgettext: create file with empty outputdir argxhe2018-04-211-2/+6
| | | | | | | | | | Found when updating neovim. The original one will try `touch ./...file` when outputdir arg is empty. But it failed because cmake passed an absolute path to our script. After my modification, it will still try to touch file in a relative path with a empty outputdir arg, but wont fail when the outputfile arg is an absolute path.
* Added gl_TYPE_WINT_T_PREREQMatúš Olekšák2018-03-131-0/+12
|
* Added quotation marka in autopoint.inRessLinux BuildPC2018-03-111-7/+7
| | | | Without double quotes, the non-portable path will fail the execution.
* Dynamically copy Makefile.in.inRessLinux BuildPC2018-03-111-0/+6
| | | | | | As pointed out in https://github.com/sabotage-linux/gettext-tiny/issues/21 , there're multiple destinations for Makefile.in. We need to figure out all destinations coded in configure.ac dynamically.
* Added Makevars.templateRessLinux BuildPC2018-03-112-0/+84
|
* Removed ABOUT-NLS dirprefixRessLinux BuildPC2018-03-111-1/+1
| | | | | | | This commit fixed the bug introduced in the previous commit. ABOUT-NLS is not affected by `AC_CONFIG_AUX_DIR` option. Details in https://github.com/sabotage-linux/gettext-tiny/issues/18.
* Added AC_CONFIG_AUX_DIR support for autopointMatúš Olekšák2018-03-111-1/+11
| | | | | | To solve https://github.com/sabotage-linux/gettext-tiny/issues/18, config.rpath should be placed at the right place asked by configure.ac, as well as ABOUT-NLS.
* msgmerge: make convbuf a local var of functionxhe2018-02-181-7/+7
| | | | | | | As discussed with rofl0r, stack allocation is super fast. We could just make convbuf a local variable, for not to confuse readers. This buffer is only used in this function, and we dont need to worry about the performance of repeated allocation.
* msgmerge: a better solution to escape textsxhe2018-01-231-10/+9
| | | | https://github.com/sabotage-linux/gettext-tiny/commit/11e4f3cde9559538e8f35f4dc4f53333b96f3512. As rofl0r said, a global buffer is a bit ugly. I moved it to the struct fiLes. And i missed out that escape() dont need a clean, zero filled buffer at all.
* msgmerge: escape texts before outputxhe2018-01-231-5/+10
| | | | | | Texts passed to process are unescaped automatically by lib, but what we need to output is escaped texts. Or msgfmt cant work with them correctly.
* xgettext: touch the file correctlyxhe2018-01-231-11/+3
| | | | | | It's obviously wrong that touching files under outputdir, when output dir is empty. Also, the original code is too complex, it should be done with less and tidy code.
* msgmerge: handle both '-' and files as inputsxhe2018-01-221-1/+20
| | | | | | | | | | | This is a similiar issue to the one fixed in msgfmt. When the input is '-', code stepped in to the fisrt if branch. But, this could either an option or a '-' after '-o', or even using '-' as the input of po files. As a result, it did not go into the set_file() function, this arg is completely ignored. So, here's the solution: put the handle codes in the first branch, too. And '-' will never be missing again.
* poparser: ignore the invalid after commentsxhe2017-12-101-3/+3
| | | | | | | | | | | | | | | | | when compiling gdk-pixbuf 2.36.11, msgfmt segfaulted because poparser went though a situation where: ``` msgstr[1] "" "ssss "vvvv ``` In case, it extracted the string ' "ssss" ' and see the remaining part ' vvvv ' as the invalid, there's no wrong with the logic itself. But i wonder if we could just be generous with these merged strings generated by xgettext. If we insist on correctness everytime po files are updated by xgettext, we may meet numbers of abort(). Seeing gnu one ignoring these obvious invalid lines, i made this commit to provide a more smooth user experience.
* msgfmt: take the arg as input after statementsxhe2017-11-091-5/+6
| | | | | | | | https://github.com/sabotage-linux/gettext-tiny/issues/16#issuecomment-342928111 If we dont handle except_in_fn at the end of all other possibilities, we may take the other flags as input file wrongly. In that case, we will ignore the codes after that block once, since except_in_fn is always 1 initially.
* msgfmt: escape '\b' as well as other charactersxhe2017-11-081-0/+3
| | | | | I failed to compile audacity pofiles due to msgfmt did not handle '\b' at all. Programs stepped in to abort directly.
* autopoint: always overwrite makefile.in/m4 filesxhe2017-11-071-2/+2
| | | | | | | Because some of our tools are just stub implementations, or not a full-feautured tool, we should always overwrite makefile.in and m4 files to ensure our programs wont die due to the GNU makefile. So we get a maximum possibility for passing the build.
* msgmerge: do not output to terminal when --updatexhe2017-11-071-0/+1
| | | | | | | i have a misunderstanding on --update, this argument is used to update the original .po file. And because we just simply copy strings from .po file, so we should just return 0, as we dont actually do anything to .po file. when --update is passed, nothing should be printed on screen.
* msgfmt: dont generate file when input is emptyxhe2017-11-071-0/+11
| | | | | | GNU one does not generate useless 'only HEADER' file when input is empty, which is cleaner and reasonable in my view. I decided to do the same thing.
* msgfmt: output to messages.mo by default like GNUxhe2017-11-071-5/+6
| | | | | I noticed GNU msgfmt did not fail when i did not specific a output file, so i decided to write the output to "messages.mo" like GNU one.
* msgfmt: make in/out arguments parse code cleanerxhe2017-11-071-6/+6
| | | | | | | | | | Prepare for the next commit. 1. Using except_out_fn flag is a little complex, we could just get the filename by 'arg++ && A'. 2. i previously check except_in_fn in the block 'if (A[0] == '-')' to prevent ignoring the input file named '-..'. Again, i add similiar codes to 'A[1] == '-'' to prevent ignoring file named '--...'.
* msgfmt: stub implementation for catalog generationxhe2017-11-071-9/+23
| | | | | | | | | | | | | | | | | | | https://github.com/sabotage-linux/gettext-tiny/issues/16 Generally speaking, `-l XX -d po --language` is passed to msgfmt to generate catalog, only one standalone parameter does not make sense. As catalog has been replaced by gettext, we just stub it. Here're the changes to stub these three arguments: 1. -l is followed by a language idetifier, and for -d, it's followed by a directory, which is used to place the generated catalog files. 2. When passed `--language`, like `msgfmt --tcl...`, we cant specific -o at the same time. Gnu error: `msgfmt: --tcl and --output-file are mutually exclusive .` That means there should be no output on terminal but that `-d` despite the input file. Dont check if they're passed at the same time, as the case using `--language` is very rare, no translators are using it, but autobuild scripts, scripts only pass the correct combination.
* msgmerge: print warning instead of error on --updaterofl0r2017-10-161-1/+1
| | | | since it is not fatal anymore.
* Merge remote-tracking branch 'origin/msgmerge-stub'rofl0r2017-10-162-92/+110
|\
| * msgmerge: output as source when --update is passedxhe2017-10-161-12/+27
| | | | | | | | | | | | | | | | | | | | following https://github.com/sabotage-linux/gettext-tiny/issues/14, because there're programs using msgmerge --update, abort may break the build. As our goal is not to provide these utils of translators, we assume that nobody would actually make use of these utils. We just provide a stub to pass the build safely.
| * fix: writestr() should do nothing when empty .poxhe2017-10-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/sabotage-linux/gettext-tiny/issues/14. At line:439, writestr() is called to write down those strings that have not been wrote down in the main loop. When po files are empty, nothing is wrote down, so d->plurals_count == 0. Then, deleting 'invalid' codes in writestr() was executed wrongly. -1 is not a valid index, qsort will segfault, of course. To fix the bug, we check d->num[pe_msgid]>0, so it will do nothing when the files are empty.
| * msgfmt: use more 'easy-to-read' variable namesxhe2017-10-161-80/+80
| | | | | | | | | | | | to make the code more clear. as rofl0r said, it's hard to understand what the code is doing without some 'tips'. now it should be clear enough that what these vars are for.
* | Merge pull request #13 from sabotage-linux/autopoint-makefilexhe2017-08-303-17/+180
|\ \ | |/ |/| support auto generation of po Makefile
| * [3/3]: refactoring Makefile.in.inautopoint-makefilexhe2017-08-303-345/+19
| | | | | | | | | | | | | | | | | | | | | | following https://github.com/sabotage-linux/gettext-tiny/issues/12 as said in the previous commit, the gnu makefile does not work. So, here, i delete all actions like updating po files by POT, refresh files...etc. I kicked all stuff out of Makefile, except building .po files and installing .mo files. The original file installation logic is kept, either, for not to damage the eco system of autotools. Issue is completely solved after these three commits.
| * [2/3]: introduce GNU makefilexhe2017-08-301-0/+489
| | | | | | | | | | | | | | | | | | | | | | | | | | following https://github.com/sabotage-linux/gettext-tiny/issues/12 this for supporting auto generation of po Makefile. Softwares may not write their own Makefile.in for po/* at all. Instead, they depend on autotools to generate Makefile. And the template makefile.in.in comes from autopoint. But the gnu one does not suite gettext-tiny, since xgettext and msgmerge both are stubs. So, this commit did not work, and it may cause error, DO NOT USE! A suitable version is to be added in the next commit.
| * [1/3]: more flexible way of installing share filesxhe2017-08-302-5/+5
|/ | | | | | | | | | | | following https://github.com/sabotage-linux/gettext-tiny/issues/12 this is the first part of the solution the issue, to prepare for introducing Makefile.in.in in the next commit. we modify m4dir to datadir, as we will introduce Makefile.in.in, which should be copied to $datadir$/gettety-tiny. It's a better name. Also moving m4 to a subdir makes a cleaner structure and a good place to place Makefile.in.in.
* fix: quick-fix to auto generation of po Makefilexhe2017-08-281-1/+2
| | | | | when compiling tilda, the stub Makefile lacks `install:`, which is causing errors, this is a quick fix
* readme: announce the fisrt edition of readmev0.2.0xhe2017-07-291-0/+48
| | | | made by rofl0r
* libintl: make it optional and configurablexhe2017-07-292-4/+17
| | | | | | | | | | | | | As rofl0r suggested, libintl.a now comes in two flavours, no-op or musl, or we could just disable it. no-op: gettext functions just return the input string as translation and symbols help to get past configure scripts musl: symbols as in no-op, with libintl built-in in to recent musl version Use LIBINTL=FLAVOR, FLAVOR can be NOOP(no-op), MUSL, NONE(disable)
* fix: checking the correct flagxhe2017-07-201-2/+2
| | | | | | | found when compiling git/vi.po writestr() was executed twice due to depend on the wrong flag, this could be fixed by checking 'i'. 'i' will be 0 for at least and only one time which is suitable in case.
* more strict check for fuzzy marksxhe2017-06-181-1/+1
| | | | In ki18n/cy-ver, fuzzy appeared just at the first several lines, which is making msgfmt see header as 'the obsolete'.
* avoid setting back offset in deleting the invalidxhe2017-06-181-14/+13
| | | | | Offset caculation is not only complex, but also unreliable. It's hard to say what would happened when it meets an unexpected situation. Now, writemsg() at the end, so we only need to consider d.len[], quite simpler, faster and safer than before.
* fix: handle arg -v correctlyxhe2017-06-101-1/+1
| | | | follow commit https://github.com/sabotage-linux/gettext-tiny/commit/b49e68b34d5fb5ee328bca43d98655ec4c7f25e6, correct the code
* fix: the invalid was not deletedxhe2017-05-301-21/+19
| | | | since i reconstructed the code last time(switch to writemsg()/writelstr()), it wont delete the invalid msgid/str anymore, the original code doesnt make sense. here's the new code, which could work well with writemsg()/writestr().
* fix bug of reading from stdin:xhe2017-05-271-2/+22
| | | | | | found when compiling dnsmasq we can't fseek in stdin, we can only read it for one time so now i write them to a temporary file first instead
* malloc dynamic buffer depending on .po files:xhe2017-05-201-15/+22
| | | | | failed compiling ki18n due to the static size msgstrbuf[8120] so, we now malloc dynamic buffer, and two asserts make sure safe
* fix for rule:xhe2017-05-201-1/+1
| | | | | | | | with rtype in compiling of glib, a hidden bug was found excepted: swith(msgstr, ctxt) == la_proc reality: swith(msgstr, ctxt) == la_abort the wrong rule was introduced in https://github.com/sabotage-linux/gettext-tiny/commit/d1bd158eb7463967ab3dd9a862e14d114523d37b