Ignore:
Timestamp:
12/28/15 17:45:18 (9 years ago)
Author:
nanardon
Message:

Fix I18N

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/Makefile.PL

    r1546 r1549  
    9898sub postamble { 
    9999 
    100     my @po = map { m:lib/LATMOS/Accounts/I18N/([^\.]+)\.po$:; $1 } 
    101             glob('lib/LATMOS/Accounts/I18N/*.po'); 
    102  
    103     my $makepo = join("\n\n", map { 
    104         " 
    105 lib/LATMOS/Accounts/I18N/$_.po: lib/LATMOS/Accounts/I18N/messages.pot 
    106 \t[ -f lib/LATMOS/Accounts/I18N/$_.po ] || msginit --no-translator --input=lib/LATMOS/Accounts/I18N/messages.pot --output= --locale=$_ 
    107 \tmsgmerge -U lib/LATMOS/Accounts/I18N/$_.po lib/LATMOS/Accounts/I18N/messages.pot 
    108  
    109         " 
    110         } @po 
    111     ); 
    112  
    113     $makepo .= "\n\npo: " . join(' ', map { "lib/LATMOS/Accounts/I18N/$_.po" } @po) . "\n"; 
     100    my $makepo = ''; 
     101    my @po; 
     102 
     103    foreach (glob('po/*.po')) { 
     104        my ($po) = $_ =~  m:([^/\.]+)\.po$:; 
     105        push (@po, $po); 
     106 
     107        $makepo .= 
     108 
     109" 
     110po/$po.po: po/messages.pot 
     111\t[ -f po/$po.po ] || msginit --no-translator --input=po/messages.pot --output= --locale=$_ 
     112\tmsgmerge -U po/$po.po po/messages.pot 
     113 
     114po/$po/LC_MESSAGES/linkaccounts.mo: po/$po.po 
     115\tinstall -d po/$po/LC_MESSAGES 
     116\tmsgfmt -o \$@ \$< 
     117\n" 
     118    } 
     119 
     120    $makepo .= "\n\npo: " . join(' ', map { "po/$_.po" } @po) . "\n"; 
     121    $makepo .= "\n\nmo: " . join(' ', map { "po/$_/LC_MESSAGES/linkaccounts.mo" } @po) . "\n"; 
    114122 
    115123    <<EOF; 
    116 #.PHONY .= svnmanifest 
    117  
    118 pot: lib/LATMOS/Accounts/I18N/messages.pot 
    119  
    120 lib/LATMOS/Accounts/I18N/messages.pot: 
    121 \tcat MANIFEST | egrep '^(lib|bin)' | xargs xgettext.pl -o lib/LATMOS/Accounts/I18N/messages.pot 
     124.PHONY: po/messages.pot 
     125 
     126pot: po/messages.pot 
     127 
     128po/messages.pot: 
     129\tcat MANIFEST | egrep '^(lib|bin)' | xargs xgettext.pl -o po/messages.pot 
    122130 
    123131$makepo 
     
    182190    my $section = $self->SUPER::install(); 
    183191 
    184     $section =~ s/(^install ::.*)/$1 install_config install_templates install_data install_po/m; 
     192    $section =~ s/(^install ::.*)/$1 install_config install_templates install_data install_mo/m; 
    185193    $section =~ s/\$\(INST_BIN\) \$\(DESTINSTALL(\w*)BIN\)/$& \$(INST_MAN5DIR) \$(DESTINSTALLMAN5DIR) \$(INST_MAN8DIR) \$(DESTINSTALLMAN8DIR)/g; 
    186194 
     
    204212            $(DESTDIR)$(DATADIR) 
    205213 
    206 install_po :: 
    207         install -d $(DESTDIR)$(LOCALEDIR)/LATMOS::Accounts 
    208         $(ABSPERLRUN) -MExtUtils::Install -e 'install({ "lib/LATMOS/Accounts/I18N" => @ARGV })' \\ 
    209         $(DESTDIR)$(LOCALEDIR)/LATMOS::Accounts 
     214install_mo: mo 
     215        install -d $(DESTDIR)$(LOCALEDIR) 
     216        for i in po/*/LC_MESSAGES/linkaccounts.mo; do \\ 
     217                install -d po/$$i $(DESTDIR)$(LOCALEDIR)/$$i; \\ 
     218        done 
    210219]; 
    211220   
Note: See TracChangeset for help on using the changeset viewer.