Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/po/messages.po
6 changes: 0 additions & 6 deletions defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
\* information on how to configure this option. */
char DEFAULT_BANNER_FORMAT[]= S_("#O Version #V, Compiled #C\n#N #M #X #T #P, #R RAM, #B\n#H\n");
char DEFAULT_CLASSIC_FORMAT[]= S_("#O Version #V\nCompiled #C\n#N #M #X #T #P, #R RAM\n#B\n#H\n");
/* Plural. With the coming of i18n you really can't assume plurals can */
/* be made by adding a string to the end. Hopefully this can fix it for*/
/* most languages. If they require significant word-order changes then */
/* we'll have even more problems */
char PROCESSOR_SINGULAR[]= S_("Processor");
char PROCESSOR_PLURAL[]= S_("Processors");

/* This option picks the default mode of the linux_logo program. *\
\* If a 1 is picked, banner mode will be the default mode. */
Expand Down
20 changes: 9 additions & 11 deletions linux_logo.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#define _(String) gettext((String))
#else
#define _(String) (String)
static const char *ngettext(const char *__msgid1, const char *__msgid2,
unsigned long int __n) {
return __n == 1 ? __msgid1:__msgid2;
}
#endif

/* Change the values in the below file to alter default behavior */
Expand Down Expand Up @@ -385,17 +389,11 @@ static int generate_sysinfo(
case 'O': vmw_strcat(temp_line,os_info.os_name,
BUFSIZ-strlen(temp_line));
break;
/* #P prints "Processor" or its plural. Sort of a hack */
/* This probably doesn't work with all languages */
case 'P': if (cpu_info.num_cpus!=1) {
vmw_strcat(temp_line,_(PROCESSOR_PLURAL),
BUFSIZ-strlen(temp_line));
}
else {
vmw_strcat(temp_line,_(PROCESSOR_SINGULAR),
BUFSIZ-strlen(temp_line));
}
break;
/* #P prints "Processor" or its plural */
case 'P': vmw_strcat(temp_line,
ngettext("Processor","Processors",cpu_info.num_cpus),
BUFSIZ-strlen(temp_line));
break;
/* #R prints the amount of memory */
case 'R': mem_size=get_mem_size();

Expand Down
27 changes: 11 additions & 16 deletions po/Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@
include ../Makefile.default

PACKAGE=linux_logo
INSTALL_LOCALEPATH=$(PREFIX)/share/locale
INSTALL_LOCALEPATH=$(DESTDIR)$(PREFIX)/share/locale

CATALOGS = da.mo de.mo es.mo fr.mo nb.mo nl.mo it.mo pl.mo pt_BR.mo ru.mo sv.mo uk.mo zh_TW.mo
PO_FILES = $(wildcard *.po)
LINGUAS = $(basename $(PO_FILES))
CATALOGS = $(addsuffix .mo,$(LINGUAS))

POTFILES= ../*.c ../*.h

all: $(PACKAGE).pot $(CATALOGS)
all: $(CATALOGS)

$(PACKAGE).pot: $(POTFILES)
$(XGETTEXT) --default-domain=$(PACKAGE) --add-comments --keyword=_ --keyword=S_ $(POTFILES);
if cmp -s $(PACKAGE).po $(PACKAGE).pot; then \
rm -f $(PACKAGE).po; \
else \
mv $(PACKAGE).po $(PACKAGE).pot; \
fi
$(XGETTEXT) --output=$@ --default-domain=$(PACKAGE) --add-comments --keyword=_ --keyword=S_ $^

clean:
rm -f *mo *~ *.bac

install: $(CATALOGS)
for n in $(CATALOGS); do \
l=`basename $$n .mo`; \
for l in $(LINGUAS); do \
$(INSTALL) -c -m 755 -d $(INSTALL_LOCALEPATH)/$$l; \
$(INSTALL) -c -m 755 -d $(INSTALL_LOCALEPATH)/$$l/LC_MESSAGES; \
$(INSTALL) -c -m 644 $$n $(INSTALL_LOCALEPATH)/$$l/LC_MESSAGES/$(PACKAGE).mo; \
$(INSTALL) -c -m 644 $$l.mo $(INSTALL_LOCALEPATH)/$$l/LC_MESSAGES/$(PACKAGE).mo; \
done

%.mo: %.po
msgfmt -o $@ $<
msgfmt -c -o $@ $<

update: $(PACKAGE).pot
for n in $(CATALOGS); do \
l=`basename $$n .mo`; \
for l in $(LINGUAS); do \
l=$$l".po"; \
mv -f $$l $$l".bac"; \
msgmerge -o $$l $$l".bac" $(PACKAGE).pot; \
msgmerge --previous -o $$l $$l".bac" $(PACKAGE).pot; \
done
89 changes: 0 additions & 89 deletions po/messages.po

This file was deleted.