Locale-PO-0.23/0000755000175000017500000000000012104420072012505 5ustar cosimocosimoLocale-PO-0.23/t/0000755000175000017500000000000012104420072012750 5ustar cosimocosimoLocale-PO-0.23/t/test.pot0000644000175000017500000011204012104417254014461 0ustar cosimocosimo# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" #: src/access.c:192 #: src/access.c:196 msgid "No %s file found." msgstr "" #: src/access.c:229 #, locale-po-flag-test, another-flag, c-format msgid "Failed to add access node!" msgstr "" #: src/access.c:261 msgid "Unable to open %s." msgstr "" #: src/access.c:476 msgctxt "SITE_LOCK" msgid "---- @sitelock will add sites immediately below this line ----" msgstr "" #: src/access.c:547 msgid "Unknown access option: %s" msgstr "" #: src/access.c:549 msgid "Unknown access flag: %s" msgstr "" #: src/atr_tab.c:184 msgid "Which attribute do you mean?" msgstr "" #: src/atr_tab.c:189 msgid "I don't understand those permissions." msgstr "" #: src/atr_tab.c:202 msgid "Critical memory failure - Alert God!" msgstr "" #: src/atr_tab.c:203 msgid "do_attribute_access: unable to malloc ATTR" msgstr "" #: src/atr_tab.c:226 msgid "%s -- Attribute permissions now: %s" msgstr "" #: src/atr_tab.c:239 msgid "Which attribute do you mean?" msgstr "" #: src/atr_tab.c:246 msgid "That attribute isn't in the attribute table" msgstr "" #: src/atr_tab.c:252 msgid "Removed %s from attribute table." msgstr "" #: src/atr_tab.c:264 msgid "Which attributes do you mean?" msgstr "" #: src/atr_tab.c:273 msgid "The name %s is already used in the attribute table." msgstr "" #: src/atr_tab.c:280 msgid "That attribute isn't in the attribute table" msgstr "" #: src/atr_tab.c:288 msgid "Renamed %s to %s in attribute table." msgstr "" #: src/atr_tab.c:300 msgid "Which attribute do you mean?" msgstr "" #: src/atr_tab.c:307 msgid "That attribute isn't in the attribute table" msgstr "" #: src/atr_tab.c:310 msgid "Attribute: %s" msgstr "" #: src/atr_tab.c:312 msgid " Flags: %s" msgstr "" #: src/atr_tab.c:313 msgid " Creator: #%d" msgstr "" #: src/atr_tab.c:342 msgid "Attribs:" msgstr "" #: src/attrib.c:274 msgid "Attempt to create too many attributes" msgstr "" #: src/attrib.c:716 msgid "ERROR: Invalid attribute number in convert_atr. aborting.\n" msgstr "" #: src/attrib.c:907 msgid "That is not a valid alias." msgstr "" #: src/attrib.c:915 msgid "That is not a valid alias." msgstr "" #: src/attrib.c:928 msgid "That attribute cannot be changed by you." msgstr "" #: src/attrib.c:931 msgid "No such attribute to reset." msgstr "" #: src/attrib.c:949 msgid "%s loses its ears and becomes deaf." msgstr "" #: src/attrib.c:953 msgid "%s grows ears and can now hear." msgstr "" #: src/attrib.c:958 msgid "Set" msgstr "" #: src/attrib.c:958 msgid "Cleared" msgstr "" #: src/attrib.c:985 msgid "You need to give an object/attribute pair." msgstr "" #: src/attrib.c:989 msgid "You need to give an object/attribute pair." msgstr "" #: src/access.c:473 msgid " COMMENT: %s" msgstr "" #: src/announce.c:92 msgid "CONNECTION made from %s at %s" msgstr "" #: src/announce.c:73 msgid "announce: pid %d running on port %d\n" msgstr "" #: src/atr_tab.c:165 msgid "ATR INIT: attribute alias %s matches no known attribute.\n" msgstr "" #: src/attrib.c:937 msgid "Alias set." msgstr "" #: src/attrib.c:939 msgid "Alias removed." msgstr "" #: src/attrib.c:1022 msgid "That attribute is %s." msgstr "" #: src/attrib.c:1023 msgid "locked" msgstr "" #: src/attrib.c:1023 msgid "unlocked" msgstr "" #: src/attrib.c:1026 msgid "You need to own the attribute to change its lock." msgstr "" #: src/attrib.c:1031 msgid "Attribute locked." msgstr "" #: src/attrib.c:1035 msgid "Attribute unlocked." msgstr "" #: src/attrib.c:1038 msgid "Invalid status on atrlock.. Notify god." msgstr "" #: src/attrib.c:1043 msgid "No such attribute." msgstr "" #: src/attrib.c:1058 msgid "You need to give an object/attribute pair." msgstr "" #: src/attrib.c:1062 msgid "You need to give an object/attribute pair." msgstr "" #: src/attrib.c:1076 msgid "I can't find that player" msgstr "" #: src/attrib.c:1107 msgid "You can only chown an attribute to the current owner of the object." msgstr "" #: src/attrib.c:1111 msgid "Attribute owner changed." msgstr "" #: src/attrib.c:1114 msgid "You don't have the permission to chown that." msgstr "" #: src/attrib.c:1118 msgid "No such attribute." msgstr "" #: src/boolexp.c:105 msgid "Sorry, broken lock!" msgstr "" #: src/boolexp.c:152 msgid "Bad boolexp type %d in object #%d" msgstr "" #: src/boolexp.c:158 msgid "Broken lock type %s in object called by #%d" msgstr "" #: src/boolexp.c:261 msgid "I don't see %s here." msgstr "" #: src/boolexp.c:265 msgid "I don't know which %s you mean!" msgstr "" #: src/bsd.c:250 msgid "Either that player does not exist, or has a different password.\\r\n" msgstr "" #: src/bsd.c:252 msgid "Either there is already a player with that name, or that name is illegal.\\r\n" msgstr "" #: src/bsd.c:254 msgid "Unable to register that player with that email address.\\r\n" msgstr "" #: src/bsd.c:256 msgid "Registration successful! You will receive your password by email.\\r\n" msgstr "" #: src/bsd.c:258 msgid "" "\\r\n" "\\r\n" msgstr "" #: src/bsd.c:260 msgid "" "\\r\n" "\\x1B[0m\\r\n" msgstr "" #: src/bsd.c:262 msgid "Going down - Bye\\r\n" msgstr "" #: src/bsd.c:484 msgid "ERROR: Usage: %s config_file error_log_file\n" msgstr "" #: src/bsd.c:497 msgid "Error %i on WSAStartup\n" msgstr "" #: src/bsd.c:514 msgid "Running under Windows %s\n" msgstr "" #: src/bsd.c:536 msgid "Failed to set ctype locale from environment.\n" msgstr "" #: src/bsd.c:538 msgid "Failed to set time locale from environment.\n" msgstr "" #: src/bsd.c:540 msgid "Failed to set messages locale from environment.\n" msgstr "" #: src/bsd.c:555 msgid "Unable to open %s. Error output to stderr.\n" msgstr "" #: src/bsd.c:557 msgid "Redirecting output to: %s\n" msgstr "" #: src/bsd.c:559 msgid "Ack! Failed reopening stderr!" msgstr "" #: src/bsd.c:606 msgid "ERROR: Couldn't load databases! Exiting.\n" msgstr "" #: src/bsd.c:636 msgid "Error %ld (%s) on CreateIoCompletionPort\n" msgstr "" #: src/bsd.c:656 msgid "Error %ld on Win32: bind\n" msgstr "" #: src/bsd.c:664 msgid "Error %ld on Win32: listen\n" msgstr "" #: src/bsd.c:673 msgid "Error %ld on _beginthread\n" msgstr "" #: src/bsd.c:677 msgid "Listening (NT-style) on port %d\n" msgstr "" #: src/bsd.c:727 msgid "" "\n" "MUSH shutdown completed.\n" msgstr "" #: src/bsd.c:758 msgid "Unable to open %s. Error output continues to stderr.\n" msgstr "" #: src/bsd.c:761 msgid "Ack! Failed reopening stderr!" msgstr "" #: src/bsd.c:1732 msgid "%d file descriptors available.\n" msgstr "" #: src/bsd.c:1733 msgid "RESTART FINISHED.\n" msgstr "" #: src/bsd.c:1748 msgid "GAME: Shutdown by external signal" msgstr "" #: src/bsd.c:1749 msgid "SHUTDOWN by external signal" msgstr "" #: src/bsd.c:1759 msgid "DUMP by external signal" msgstr "" #: src/bsd.c:1951 msgid "[%d/%s/%s] Refused connection (remote port %d)" msgstr "" #: src/bsd.c:1960 msgid "[%d/%s/%s] Connection opened." msgstr "" #: src/bsd.c:2021 msgid "couldn't open cached text file '%s'" msgstr "" #: src/bsd.c:2144 msgid "Below maximum player limit of %d. Logins enabled." msgstr "" #: src/bsd.c:2149 msgid "[%d/%s/%s] Logout, never connected. " msgstr "" #: src/bsd.c:2191 msgid "[%d/%s/%s] Logout by %s(#%d)" msgstr "" #: src/bsd.c:2206 msgid "Below maximum player limit of %d. Logins enabled." msgstr "" #: src/bsd.c:2210 msgid "[%d/%s/%s] Connection closed, never connected." msgstr "" #: src/bsd.c:2518 msgid "[%d/%s/%s] Refused connection (remote port %d)" msgstr "" #: src/bsd.c:2672 msgid "[%d/%s/%s] Connection opened." msgstr "" #: src/bsd.c:3065 msgid "Help topics don't start with '&'." msgstr "" #: src/bsd.c:3073 msgid "You don't look like an admin to me." msgstr "" #: src/bsd.c:3081 msgid "Sorry, that function is temporarily unavailable." msgstr "" #: src/bsd.c:3082 msgid "Can't open index file %s for reading" msgstr "" #: src/bsd.c:3090 msgid "No entry for '%s'." msgstr "" #: src/bsd.c:3094 msgid "Sorry, that function is temporarily unavailable." msgstr "" #: src/bsd.c:3095 msgid "Can't open text file %s for reading" msgstr "" #: src/bsd.c:3099 msgid "Sorry, that function is temporarily unavailable." msgstr "" #: src/bsd.c:3100 msgid "Seek error in file %s\n" msgstr "" #: src/bsd.c:3303 msgid "[%d/%s/%s] Switching to Pueblo mode." msgstr "" #: src/bsd.c:3352 msgid "Limit of %d players reached. Logins disabled.\n" msgstr "" #: src/bsd.c:3405 msgid "%ld failed connections since last login." msgstr "" #: src/bsd.c:3419 msgid "Your HAVEN flag is set. You cannot receive pages." msgstr "" #: src/bsd.c:3422 msgid "Welcome back from vacation!" msgstr "" #: src/bsd.c:3444 msgid "[%d/%s/%s] Failed connect to '%s'." msgstr "" #: src/bsd.c:3447 msgid "[%d/%s/%s] Connected to %s(#%d) in %s(#%d)" msgstr "" #: src/bsd.c:3459 msgid "[%d/%s/%s] Failed connect to '%s'." msgstr "" #: src/bsd.c:3463 msgid "[%d/%s/%s] Connected dark to %s(#%d) in %s(#%d)" msgstr "" #: src/bsd.c:3479 msgid "[%d/%s/%s] Failed connect to '%s'." msgstr "" #: src/bsd.c:3482 msgid "[%d/%s/%s] Connected to %s(#%d) in %s(#%d)" msgstr "" #: src/bsd.c:3498 msgid "[%d/%s/%s] Failed connect to '%s'." msgstr "" #: src/bsd.c:3502 msgid "[%d/%s/%s] Connected hidden to %s(#%d) in %s(#%d)" msgstr "" #: src/bsd.c:3521 msgid "[%d/%s/%s] Refused create for '%s'." msgstr "" #: src/bsd.c:3529 msgid "REFUSED CREATION for %s from %s on descriptor %d.\n" msgstr "" #: src/bsd.c:3535 msgid "REFUSED CREATION for %s from %s on descriptor %d.\n" msgstr "" #: src/bsd.c:3543 msgid "[%d/%s/%s] Failed create for '%s' (bad name)." msgstr "" #: src/bsd.c:3548 msgid "[%d/%s/%s] Failed create for '%s' (bad password)." msgstr "" #: src/bsd.c:3551 msgid "[%d/%s/%s] Created %s(#%d)" msgstr "" #: src/bsd.c:3565 msgid "[%d/%s/%s] Refused registration (bad site) for '%s'." msgstr "" #: src/bsd.c:3573 msgid "Refused registration (creation disabled) for %s from %s on descriptor %d.\n" msgstr "" #: src/bsd.c:3580 msgid "[%d/%s/%s] Failed registration for '%s'." msgstr "" #: src/bsd.c:3584 msgid "[%d/%s/%s] Registered %s(#%d) to %s" msgstr "" #: src/bsd.c:3824 msgid "Bogus caller #%d of dump_users" msgstr "" #: src/bsd.c:3900 msgid "There are no players connected.\\r\n" msgstr "" #: src/bsd.c:3903 msgid "There is 1 player connected.\\r\n" msgstr "" #: src/bsd.c:3906 msgid "There are %d players connected.\\r\n" msgstr "" #: src/bsd.c:3978 msgid "%s created." msgstr "" #: src/bsd.c:4015 msgid "You are nowhere!" msgstr "" #: src/bsd.c:4083 msgid "Invalid zone #%d for %s(#%d) has bad type %d" msgstr "" #: src/bsd.c:4136 msgid "%s has disconnected." msgstr "" #: src/bsd.c:4189 msgid "Invalid zone #%d for %s(#%d) has bad type %d" msgstr "" #: src/bsd.c:4212 msgid "%s has partially disconnected." msgstr "" #: src/bsd.c:4256 msgid "You may get 15 minutes of fame and glory in life, but not right now." msgstr "" #: src/bsd.c:4262 msgid "Motd set." msgstr "" #: src/bsd.c:4266 msgid "Wizard motd set." msgstr "" #: src/bsd.c:4270 msgid "Down motd set." msgstr "" #: src/bsd.c:4274 msgid "Full motd set." msgstr "" #: src/bsd.c:4297 msgid "Why would you want to do that?" msgstr "" #: src/bsd.c:4316 msgid "Doing set. %d characters lost." msgstr "" #: src/bsd.c:4319 msgid "Doing set." msgstr "" #: src/bsd.c:4330 msgid "Who do you think you are, Gallup?" msgstr "" #: src/bsd.c:4337 msgid "Poll set. %d characters lost." msgstr "" #: src/bsd.c:4340 msgid "Poll set." msgstr "" #: src/bsd.c:4341 msgid "Poll Set to '%s'." msgstr "" #: src/bsd.c:4456 msgid "Whoa. doing() can't find player #%d on call by #%d\n" msgstr "" #: src/bsd.c:4485 msgid "#-1 NOT CONNECTED" msgstr "" #: src/bsd.c:4498 msgid "#-1 NOT CONNECTED" msgstr "" #: src/bsd.c:4589 msgid "Permission denied." msgstr "" #: src/bsd.c:4627 msgid "Permission denied." msgstr "" #: src/bsd.c:4639 msgid "You no longer appear on the WHO list." msgstr "" #: src/bsd.c:4641 msgid "You now appear on the WHO list." msgstr "" #: src/bsd.c:4673 msgid "" "\n" "*** Inactivity timeout ***\n" msgstr "" #: src/bsd.c:4675 msgid "[%d/%s/%s] Logout by %s(#%d) " msgstr "" #: src/bsd.c:4683 msgid "" "\n" "*** Inactivity limit reached. You are now HIDDEN. ***\n" msgstr "" #: src/bsd.c:4788 msgid "There are no connected players on that channel." msgstr "" #: src/bsd.c:4790 msgid "Connected players on that channel are:" msgstr "" #: src/bsd.c:4807 msgid "No such channel." msgstr "" #: src/bsd.c:4810 msgid "I can't tell which channel you mean." msgstr "" #: src/bsd.c:4827 msgid "#-1 NO PERMISSIONS FOR CHANNEL" msgstr "" #: src/bsd.c:5057 msgid "GAME: Error writing reboot database!" msgstr "" #: src/bsd.c:5185 msgid "GAME: Reboot finished." msgstr "" #: src/bsd.c:5211 msgid "Starting MUD listening thread ...\n" msgstr "" #: src/bsd.c:5235 msgid "[%d/%s] Refused connection (remote port %d)" msgstr "" #: src/bsd.c:5241 msgid "[%d/%s] Connection opened." msgstr "" #: src/bsd.c:5245 msgid "[%d/%s] Connection opened.\n" msgstr "" #: src/bsd.c:5276 msgid "End of MUD listening thread ...\n" msgstr "" #: src/cmds.c:181 msgid "You can't remake the world in your image." msgstr "" #: src/cmds.c:185 msgid "What did you want to set?" msgstr "" #: src/cmds.c:189 msgid "What did you want to set that to?" msgstr "" #: src/cmds.c:193 msgid "Couldn't set that option" msgstr "" #: src/cmds.c:195 msgid "Option set." msgstr "" #: src/cmds.c:228 msgid "You must specify a type of lock" msgstr "" #: src/command.c:598 msgid "ALIAS : %s for nonexistant command %s" msgstr "" #: src/command.c:965 msgid "%s doesn't know switch %s." msgstr "" #: src/command.c:1022 msgid "No command vector on command %s." msgstr "" #: src/command.c:1100 msgid "No such command." msgstr "" #: src/command.c:1110 msgid "Where's your pointy hat?" msgstr "" #: src/command.c:1114 msgid "How do you want to restrict the command?" msgstr "" #: src/command.c:1119 msgid "Restrict attempt failed." msgstr "" #: src/command.c:1123 msgid "@command is ALWAYS enabled." msgstr "" #: src/command.c:1249 msgid "You cannot do that while gagged." msgstr "" #: src/command.c:1253 msgid "You cannot do that while fixed." msgstr "" #: src/command.c:1257 msgid "Guests cannot do that." msgstr "" #: src/command.c:1261 msgid "Only God can do that." msgstr "" #: src/command.c:1281 msgid "Permission denied, command is type-restricted." msgstr "" #: src/command.c:1293 msgid "Permission denied." msgstr "" #: src/comp_h.c:268 msgid "Cannot allocate memory for compression tree. Aborting.\n" msgstr "" #: src/comp_h.c:305 msgid "Illegal compression code length (%d). Aborting.\n" msgstr "" #: src/comp_h.c:350 msgid "Cannot allocate memory for compression tree. Aborting.\n" msgstr "" #: src/comp_h.c:443 msgid "Cannot allocate memory for compression tree. Aborting.\n" msgstr "" #: src/comp_h.c:492 msgid "Cannot allocate memory for compression tree. Aborting.\n" msgstr "" #: src/comp_h.c:517 msgid "Cannot allocate memory for compression tree. Aborting.\n" msgstr "" #: src/comp_w.c:290 msgid "Error in string decompression occurred during panic dump.\n" msgstr "" #: src/comp_w.c:294 msgid "Error in string decompression, i = %i\n" msgstr "" #: src/comp_w.c:295 msgid "Fatal error in decompression" msgstr "" #: src/conf.c:346 msgid "CONFIG: option %s value limited to %d\n" msgstr "" #: src/conf.c:384 msgid "CONFIG: weird flag set directive '%s'\n" msgstr "" #: src/conf.c:389 msgid "CONFIG: flag '%s' cannot be set.\n" msgstr "" #: src/conf.c:394 msgid "CONFIG: flag '%s' for type not found.\n" msgstr "" #: src/conf.c:434 msgid "CONFIG: Invalid command or restriction for %s.\n" msgstr "" #: src/conf.c:443 msgid "CONFIG: restrict_command %s requires a restriction value.\n" msgstr "" #: src/conf.c:466 msgid "CONFIG: directive '%s' in cnf file ignored.\n" msgstr "" #: src/conf.c:494 msgid "GAME: Dump complete. Time in." msgstr "" #: src/conf.c:508 msgid "Penny" msgstr "" #: src/conf.c:509 msgid "Pennies" msgstr "" #: src/conf.c:564 msgid "GAME: Database will be dumped in 5 minutes." msgstr "" #: src/conf.c:659 msgid "ERROR: Cannot open configuration file %s.\n" msgstr "" #: src/conf.c:702 msgid "CONFIG: include depth too deep in file %s\n" msgstr "" #: src/conf.c:720 msgid "CONFIG: directive '%s' missing from cnf file, using default value.\n" msgstr "" #: src/conf.c:771 msgid "I only know the following types of options:" msgstr "" #: src/conf.c:791 msgid "Use: @config/list where type is one of:" msgstr "" #: src/conf.c:889 msgid "#-1 PERMISSION DENIED" msgstr "" #: src/db.c:152 msgid "ERROR: out of memory!\n" msgstr "" #: src/db.c:164 msgid "ERROR: out of memory!\n" msgstr "" #: src/db.c:510 msgid "***END OF DUMP***\n" msgstr "" #: src/db.c:567 msgid " * Bad attribute name on #%d. Changing name to %s.\n" msgstr "" #: src/db.c:574 msgid " * Bad owner on attribute %s on #%d.\n" msgstr "" #: src/db.c:608 msgid " * Bad text in attribute %s on #%d. Changed to:\n" msgstr "" #: src/db.c:666 msgid "PARANOID WRITE BEGINNING...\n" msgstr "" #: src/db.c:686 msgid "\t...wrote up to object #%d\n" msgstr "" #: src/db.c:688 msgid "***END OF DUMP***\n" msgstr "" #: src/db.c:689 msgid "\t...finished at object #%d\n" msgstr "" #: src/db.c:690 msgid "END OF PARANOID WRITE.\n" msgstr "" #: src/db.c:1236 msgid "ERROR: Bad format on new attributes. object #%d\n" msgstr "" #: src/db.c:1242 msgid "ERROR: Bad format on new attribute %s. object #%d\n" msgstr "" #: src/db.c:1273 msgid "** WARNING ** Hard newline in attribute %s on object #%d\n" msgstr "" #: src/db.c:1296 msgid "ERROR: no line feed after < on object %d\n" msgstr "" #: src/db.c:1302 msgid "ERROR: Unexpected EOF on file.\n" msgstr "" #: src/db.c:1306 msgid "ERROR: Bad character %c (%d) in attribute list on object %d\n" msgstr "" #: src/db.c:1309 msgid " (expecting ], >, or < as first character of the line.)\n" msgstr "" #: src/db.c:1311 msgid " Last attribute read was: %s\n" msgstr "" #: src/db.c:1313 msgid " No attributes had been read yet.\n" msgstr "" #: src/db.c:1353 msgid "ERROR: old style database.\n" msgstr "" #: src/db.c:1472 msgid "ERROR: bad attribute list object %d\n" msgstr "" #: src/db.c:1490 msgid "***END OF DUMP***" msgstr "" #: src/db.c:1491 msgid "ERROR: No end of dump %d\n" msgstr "" #: src/db.c:1495 msgid "READING: done\n" msgstr "" #: src/db.c:1504 msgid "ERROR: failed object %d\n" msgstr "" #: src/destroy.c:212 msgid "Destroying that again is hardly necessary." msgstr "" #: src/destroy.c:216 msgid "Destroying God would be blasphemous." msgstr "" #: src/destroy.c:228 msgid "Permission denied." msgstr "" #: src/destroy.c:232 msgid "That is too special to be destroyed." msgstr "" #: src/destroy.c:238 msgid "That object is set SAFE. You must set it !SAFE before destroying it." msgstr "" #: src/destroy.c:243 msgid "That object is marked SAFE. Use @nuke to destroy it." msgstr "" #: src/destroy.c:250 msgid "That object does not belong to you. Use @nuke to destroy it." msgstr "" #: src/destroy.c:257 msgid "Programs don't kill people; people kill people!" msgstr "" #: src/destroy.c:266 msgid "Sorry, no suicide allowed." msgstr "" #: src/destroy.c:271 msgid "Even you can't do that!" msgstr "" #: src/destroy.c:276 msgid "How gruesome. You may not destroy players who are connected." msgstr "" #: src/destroy.c:280 msgid "You must use @nuke to destroy a player." msgstr "" #: src/destroy.c:287 msgid "That object is set WIZARD. You must use @nuke to destroy it." msgstr "" #: src/destroy.c:291 msgid "No home-wrecking allowed! Relink first." msgstr "" #: src/destroy.c:297 msgid "No home-wrecking allowed! Relink first." msgstr "" #: src/destroy.c:325 msgid "Destroyed." msgstr "" #: src/destroy.c:333 msgid "The room shakes and begins to crumble." msgstr "" #: src/destroy.c:336 msgid "You will be rewarded shortly for %s." msgstr "" #: src/destroy.c:341 msgid "The wrecking ball is on its way for %s's %s and its exits." msgstr "" #: src/destroy.c:344 msgid "%s has scheduled your room %s to be destroyed." msgstr "" #: src/destroy.c:352 msgid "%s and all their objects are scheduled to be destroyed." msgstr "" #: src/destroy.c:357 msgid "%s's %s is scheduled to be destroyed." msgstr "" #: src/destroy.c:361 msgid "%s has scheduled your %s for destruction." msgstr "" #: src/destroy.c:364 msgid "%s is scheduled to be destroyed." msgstr "" #: src/destroy.c:371 msgid "%s has scheduled your %s for destruction." msgstr "" #: src/destroy.c:374 msgid "%s's %s is scheduled to be destroyed." msgstr "" #: src/destroy.c:378 msgid "%s is scheduled to be destroyed." msgstr "" #: src/destroy.c:382 msgid "Surprising type in do_destroy." msgstr "" #: src/destroy.c:405 msgid "Alas, your efforts of mercy are in vain." msgstr "" #: src/destroy.c:410 msgid "Your %s has been spared from destruction." msgstr "" #: src/destroy.c:414 msgid "%s has been spared from destruction." msgstr "" #: src/destroy.c:464 msgid "%s has scheduled your %s for destruction." msgstr "" #: src/destroy.c:470 msgid "Surprising type in pre_destroy." msgstr "" #: src/destroy.c:510 msgid "%s has been spared from destruction." msgstr "" #: src/destroy.c:514 msgid "You have been spared from destruction by %s." msgstr "" #: src/destroy.c:517 msgid "You have been spared from destruction." msgstr "" #: src/destroy.c:543 msgid "The room %s has been spared from destruction." msgstr "" #: src/destroy.c:548 msgid "The room %s has been spared from destruction by %s." msgstr "" #: src/destroy.c:565 msgid "Surprising type in un_destroy." msgstr "" #: src/destroy.c:599 msgid "Unknown type on #%d in free_object." msgstr "" #: src/destroy.c:628 msgid "ERROR: Exit %s leading from invalid room #%d destroyed." msgstr "" #: src/destroy.c:636 msgid "Found a destroyed exit #%d in room #%d" msgstr "" #: src/destroy.c:705 msgid "The floor disappears under your feet, you fall through NOTHINGness and then:" msgstr "" #: src/destroy.c:759 msgid "You get your %d %s deposit back for %s." msgstr "" #: src/destroy.c:924 msgid "Purge complete." msgstr "" #: src/destroy.c:926 msgid "Sorry, you are a mortal." msgstr "" #: src/destroy.c:1040 msgid "Found a destroyed exit #%d in room #%d" msgstr "" #: src/destroy.c:1100 msgid "ERROR: no name for room #%d." msgstr "" #: src/destroy.c:1103 msgid "You own a disconnected room, %s" msgstr "" #: src/destroy.c:1156 msgid "Bad object type found for %s in mark_contents" msgstr "" #: src/destroy.c:1178 msgid "Object %s not pointed to by anything." msgstr "" #: src/destroy.c:1181 msgid "You own an object %s that was \\'orphaned\\'." msgstr "" #: src/destroy.c:1210 msgid "It was moved to %s." msgstr "" #: src/destroy.c:1213 msgid "Moved to %s." msgstr "" #: src/destroy.c:1218 msgid "It was moved to %s." msgstr "" #: src/destroy.c:1221 msgid "Moved to %s." msgstr "" #: src/destroy.c:1225 msgid "It was destroyed." msgstr "" #: src/destroy.c:1226 msgid "Orphaned exit destroyed." msgstr "" #: src/destroy.c:1232 msgid "Disconnected room. So what?" msgstr "" #: src/destroy.c:1236 msgid "Surprising type on #%d found in check_cycles." msgstr "" #: src/destroy.c:1272 msgid "Incorrect location on object %s. Reset to #%d." msgstr "" #: src/destroy.c:1291 msgid "Incorrect source on exit %s. Reset to #%d." msgstr "" #: src/destroy.c:1319 msgid "Silly mortal chicks are for kids!" msgstr "" #: src/destroy.c:1322 msgid "GAME: Performing database consistency check." msgstr "" #: src/destroy.c:1323 msgid "DBCK done." msgstr "" #: src/destroy.c:1325 msgid "GAME: Database consistency check complete." msgstr "" #: src/extchat.c:104 msgid "CHAT: I don't recognize that channel." msgstr "" #: src/extchat.c:107 msgid "CHAT: I don't know which channel you mean." msgstr "" #: src/extchat.c:145 msgid "Unable to load channel %d." msgstr "" #: src/extchat.c:289 msgid "Bad object #%d removed from channel %s" msgstr "" #: src/extchat.c:746 msgid "You need to specify a channel." msgstr "" #: src/extchat.c:750 msgid "What do you want to do with that channel?" msgstr "" #: src/extchat.c:757 msgid "CHAT: You can't do that with channel <%s>." msgstr "" #: src/extchat.c:760 msgid "CHAT: I don't recognize that channel." msgstr "" #: src/extchat.c:782 msgid "Invalid target." msgstr "" #: src/extchat.c:787 msgid "Sorry, wrong type of thing for channel <%s>." msgstr "" #: src/extchat.c:793 msgid "Guests are not allowed to join channels." msgstr "" #: src/extchat.c:797 msgid "Invalid target." msgstr "" #: src/extchat.c:803 msgid "%s is already on channel <%s>." msgstr "" #: src/extchat.c:812 msgid "CHAT: Warning: Player does not meet channel join permissions (joining anyway)" msgstr "" #: src/extchat.c:814 msgid "Permission to join denied." msgstr "" #: src/extchat.c:821 msgid "CHAT: %s joins you to channel <%s>." msgstr "" #: src/extchat.c:824 msgid "CHAT: You join %s to channel <%s>." msgstr "" #: src/extchat.c:827 msgid "CHAT: You join channel <%s>." msgstr "" #: src/extchat.c:830 msgid "<%s> %s has joined this channel." msgstr "" #: src/extchat.c:835 msgid "%s is already on channel <%s>." msgstr "" #: src/extchat.c:846 msgid "Guests may not leave channels." msgstr "" #: src/extchat.c:852 msgid "<%s> %s has left this channel." msgstr "" #: src/extchat.c:856 msgid "CHAT: %s removes you from channel <%s>." msgstr "" #: src/extchat.c:859 msgid "CHAT: You remove %s from channel <%s>." msgstr "" #: src/extchat.c:863 msgid "CHAT: You leave channel <%s>." msgstr "" #: src/extchat.c:865 msgid "%s is not on channel <%s>." msgstr "" #: src/extchat.c:870 msgid "I don't understand what you want to do." msgstr "" #: src/extchat.c:889 msgid "Don't you have anything to say?" msgstr "" #: src/extchat.c:894 msgid "No such channel." msgstr "" #: src/extchat.c:916 msgid "Sorry, you're not the right type to be on channel <%s>." msgstr "" #: src/extchat.c:922 msgid "You must be on that channel to speak on it." msgstr "" #: src/extchat.c:927 msgid "Sorry, you're not allowed to speak on channel <%s>." msgstr "" #: src/extchat.c:968 msgid "To channel %s: %s%s%s" msgstr "" #: src/extchat.c:972 msgid "<%s> %s%s%s says, \"%s\"" msgstr "" #: src/extchat.c:977 msgid "To channel %s: %s says, \"%s\"" msgstr "" #: src/extchat.c:981 msgid "What do you want to say to that channel?" msgstr "" #: src/extchat.c:999 msgid "You can't channel-surf that well." msgstr "" #: src/extchat.c:1003 msgid "That is not a valid channel." msgstr "" #: src/extchat.c:1008 msgid "I don't recognize that channel." msgstr "" #: src/extchat.c:1011 msgid "I don't know which channel you mean." msgstr "" #: src/extchat.c:1015 msgid "CHAT: I don't recognize that channel." msgstr "" #: src/extchat.c:1021 msgid "Sorry, you're not the right type to be on channel <%s>." msgstr "" #: src/extchat.c:1029 msgid "You must be on that channel to speak on it." msgstr "" #: src/extchat.c:1034 msgid "Sorry, you're not allowed to speak on channel <%s>." msgstr "" #: src/extchat.c:1039 msgid "What do you want to emit?" msgstr "" #: src/extchat.c:1047 msgid "Cemit to channel %s: %s" msgstr "" #: src/extchat.c:1074 msgid "You must specify a channel." msgstr "" #: src/extchat.c:1078 msgid "Guests may not modify channels." msgstr "" #: src/extchat.c:1082 msgid "What do you want to do with the channel?" msgstr "" #: src/extchat.c:1093 msgid "No more room for channels." msgstr "" #: src/extchat.c:1097 msgid "The channel needs a shorter name." msgstr "" #: src/extchat.c:1101 msgid "You already own too many channels." msgstr "" #: src/extchat.c:1106 msgid "CHAT: The channel needs a more unique name." msgstr "" #: src/extchat.c:1112 msgid "You can't create channels of that type." msgstr "" #: src/extchat.c:1116 msgid "Warning: channel will be created disabled." msgstr "" #: src/extchat.c:1119 msgid "You can't afford the %d %s." msgstr "" #: src/extchat.c:1126 msgid "CHAT: No more memory for channels!" msgstr "" #: src/extchat.c:1133 msgid "CHAT: No more memory for channels!" msgstr "" #: src/extchat.c:1144 msgid "CHAT: Channel <%s> created." msgstr "" #: src/extchat.c:1150 msgid "Permission denied." msgstr "" #: src/extchat.c:1161 msgid "Channel removed." msgstr "" #: src/extchat.c:1167 msgid "Permission denied." msgstr "" #: src/extchat.c:1176 msgid "The channel needs a more unique new name." msgstr "" #: src/extchat.c:1181 msgid "That name is too long." msgstr "" #: src/extchat.c:1190 msgid "<%s> %s has renamed channel %s to %s." msgstr "" #: src/extchat.c:1192 msgid "Channel renamed." msgstr "" #: src/extchat.c:1197 msgid "Permission denied." msgstr "" #: src/extchat.c:1203 msgid "You can't make channels that type." msgstr "" #: src/extchat.c:1207 msgid "Warning: channel will be disabled." msgstr "" #: src/extchat.c:1210 msgid "Permissions on channel <%s> changed." msgstr "" #: src/extchat.c:1215 msgid "Permission denied. Use @channel/mute =" msgstr "" #: src/extchat.c:1226 msgid "Quiet status must be 'yes' or 'no'." msgstr "" #: src/extchat.c:1230 msgid "Quiet status on channel <%s> changed." msgstr "" #: src/extchat.c:1247 msgid "You must specify a channel." msgstr "" #: src/extchat.c:1254 msgid "You are not on channel <%s>." msgstr "" #: src/extchat.c:1266 msgid "You will no longer hear connection messages on channel <%s>." msgstr "" #: src/extchat.c:1274 msgid "You will now hear connection messages on channel <%s>." msgstr "" #: src/extchat.c:1279 msgid "Mute status must be 'yes' or 'no'." msgstr "" #: src/extchat.c:1291 msgid "You are not permitted to hide on channel <%s>." msgstr "" #: src/extchat.c:1298 msgid "You no longer appear on channel <%s>'s who list." msgstr "" #: src/extchat.c:1305 msgid "You now appear on channel <%s>'s who list." msgstr "" #: src/extchat.c:1310 msgid "Hide status must be 'yes' or 'no'." msgstr "" #: src/extchat.c:1322 msgid "You will no longer hear messages on channel <%s>." msgstr "" #: src/extchat.c:1329 msgid "You will now hear messages on channel <%s>." msgstr "" #: src/extchat.c:1334 msgid "Gag status must be 'yes' or 'no'." msgstr "" #: src/extchat.c:1354 msgid "You must specify a channel." msgstr "" #: src/extchat.c:1358 msgid "Title too long." msgstr "" #: src/extchat.c:1364 msgid "You are not on channel <%s>." msgstr "" #: src/extchat.c:1369 msgid "Title set." msgstr "" #: src/extchat.c:1443 msgid "CHAT: %s has removed all users from <%s>." msgstr "" #: src/extchat.c:1461 msgid "CHAT: Wipe that silly grin off your face instead." msgstr "" #: src/extchat.c:1466 msgid "CHAT: Channel <%s> wiped." msgstr "" #: src/extchat.c:1481 msgid "CHAT: Only a Wizard can do that." msgstr "" #: src/extchat.c:1488 msgid "CHAT: Invalid owner." msgstr "" #: src/extchat.c:1496 msgid "CHAT: Channel <%s> now owned by %s." msgstr "" #: src/extchat.c:1544 msgid "CHAT: Channel <%s> resists." msgstr "" #: src/extchat.c:1554 msgid "CHAT: I don't understand that key." msgstr "" #: src/extchat.c:1563 msgid "CHAT: Joinlock on <%s> %s." msgstr "" #: src/extchat.c:1571 msgid "CHAT: Speaklock on <%s> %s." msgstr "" #: src/extchat.c:1579 msgid "CHAT: Seelock on <%s> %s." msgstr "" #: src/extchat.c:1581 msgid "reset" msgstr "" #: src/extchat.c:1581 msgid "set" msgstr "" #: src/extchat.c:1587 msgid "CHAT: Hidelock on <%s> %s." msgstr "" #: src/extchat.c:1589 msgid "reset" msgstr "" #: src/extchat.c:1589 msgid "set" msgstr "" #: src/extchat.c:1595 msgid "CHAT: Modlock on <%s> %s." msgstr "" #: src/extchat.c:1597 msgid "reset" msgstr "" #: src/extchat.c:1597 msgid "set" msgstr "" #: src/extchat.c:1635 msgid "CHAT: I don't recognize that channel." msgstr "" #: src/extchat.c:1657 msgid "CHAT: No permission to decompile <%s>" msgstr "" #: src/extchat.c:1703 msgid "CHAT: No channel matches that string." msgstr "" #: src/extchat.c:1718 msgid "CHAT: New title too long." msgstr "" #: src/extchat.c:1725 msgid "CHAT: Yeah, right." msgstr "" #: src/extchat.c:1731 msgid "CHAT: Channel <%s> title cleared." msgstr "" #: src/extchat.c:1734 msgid "CHAT: Channel <%s> title set." msgstr "" #: src/extmail.c:211 msgid "(no subject)" msgstr "" #: src/extmail.c:233 msgid "MAIL: Current folder is %d [%s]." msgstr "" #: src/extmail.c:239 msgid "MAIL: What folder is that?" msgstr "" #: src/extmail.c:245 msgid "MAIL: Folder name too long" msgstr "" #: src/extmail.c:250 msgid "MAIL: Illegal folder name" msgstr "" #: src/extmail.c:255 msgid "MAIL: Folder %d now named '%s'" msgstr "" #: src/extmail.c:260 msgid "MAIL: Current folder set to %d [%s]." msgstr "" #: src/extmail.c:274 msgid "MAIL: You must specify a folder name or number" msgstr "" #: src/extmail.c:279 msgid "MAIL: What folder is that?" msgstr "" #: src/extmail.c:283 msgid "MAIL: Folder %d now has no name" msgstr "" #: src/extmail.c:357 msgid "MAIL: All messages in all folders %s." msgstr "" #: src/extmail.c:358 msgid "untagged" msgstr "" #: src/extmail.c:358 msgid "tagged" msgstr "" #: src/extmail.c:363 msgid "MAIL: Msg #%d:%d %s." msgstr "" #: src/extmail.c:364 msgid "untagged" msgstr "" #: src/extmail.c:364 msgid "tagged" msgstr "" #: src/extmail.c:370 msgid "MAIL: All messages in all folders %s." msgstr "" #: src/extmail.c:371 msgid "uncleared" msgstr "" #: src/extmail.c:371 msgid "cleared" msgstr "" #: src/extmail.c:378 msgid "MAIL: Unread Msg #%d:%d cleared! Use @mail/unclear %d:%d to recover." msgstr "" #: src/extmail.c:382 msgid "MAIL: Msg #%d:%d %s." msgstr "" #: src/extmail.c:383 msgid "uncleared" msgstr "" #: src/extmail.c:383 msgid "cleared" msgstr "" #: src/extmail.c:393 msgid "MAIL: You don't have any matching messages!" msgstr "" #: src/extmail.c:415 msgid "MAIL: Invalid folder specification" msgstr "" #: src/extmail.c:432 msgid "MAIL: All messages filed in folder %d [%s]" msgstr "" #: src/extmail.c:438 msgid "MAIL: Msg %d:%d filed in folder %d [%s]" msgstr "" #: src/extmail.c:446 msgid "MAIL: You don't have any matching messages!" msgstr "" #: src/extmail.c:518 msgid "MAIL: You don't have that many matching messages!" msgstr "" #: src/extmail.c:548 msgid "--------------------------- MAIL (folder %d) ------------------------------" msgstr "" #: src/extmail.c:668 msgid "MAIL: Mailbox purged." msgstr "" #: src/extmail.c:695 msgid "MAIL: To whom should I forward?" msgstr "" #: src/extmail.c:705 msgid "MAIL: You have no messages to forward." msgstr "" #: src/extmail.c:726 msgid "MAIL: You can't reply to nonexistant mail." msgstr "" #: src/extmail.c:747 msgid "No such unique player: %s." msgstr "" #: src/extmail.c:763 msgid "MAIL: %d messages forwarded." msgstr "" #: src/extmail.c:788 msgid "MAIL: I can't figure out who you want to mail to." msgstr "" #: src/extmail.c:792 msgid "MAIL: I can't figure out what you want to send." msgstr "" #: src/extmail.c:810 msgid "(no subject)" msgstr "" #: src/extmail.c:826 msgid "MAIL: You can't reply to nonexistent mail." msgstr "" #: src/extmail.c:859 msgid "No such unique player: %s." msgstr "" #: src/extmail.c:975 msgid "MAIL: You cannot send mail to non-existent people." msgstr "" #: src/extmail.c:979 msgid "MAIL: You probably don't wanna send mail saying 'clear'." msgstr "" #: src/extmail.c:984 msgid "MAIL: %s is not accepting mail from you right now." msgstr "" #: src/extmail.c:990 msgid "MAIL: %s's mailbox is full. Can't send." msgstr "" #: src/extmail.c:1004 msgid "(no subject)" msgstr "" #: src/extmail.c:1090 msgid "MAIL: You sent your message to %s." msgstr "" #: src/extmail.c:1091 msgid "MAIL: You have a new message (%d) from %s." msgstr "" #: src/extmail.c:1111 msgid "The postal service issues a warrant for your arrest." msgstr "" #: src/extmail.c:1129 msgid "** MAIL PURGE ** done by %s(#%d)." msgstr "" #: src/extmail.c:1131 msgid "You annihilate the post office. All messages cleared." msgstr "" #: src/extmail.c:1147 msgid "Go get some bugspray." msgstr "" #: src/extmail.c:1156 msgid "%s: no such player." msgstr "" #: src/extmail.c:1161 msgid "Mail cleared for %s(#%d)." msgstr "" #: src/extmail.c:1166 msgid "Bad object #%d has mail." msgstr "" #: src/extmail.c:1168 msgid "%s(#%d) has mail but is not a player." msgstr "" #: src/extmail.c:1174 msgid "Mail database top is %d, actual message count is %d. Fixing." msgstr "" #: src/extmail.c:1178 msgid "Mail sanity check completed." msgstr "" #: src/extmail.c:1182 msgid "Fixing mail for #%d." msgstr "" #: src/extmail.c:1216 msgid "Mail sanity fix completed." msgstr "" #: src/extmail.c:1218 msgid "That is not a debugging option." msgstr "" #: src/extmail.c:1260 msgid "%s: No such player." msgstr "" #: src/extmail.c:1264 msgid "The post office protects privacy!" msgstr "" #: src/extmail.c:1270 msgid "Sorry, that command has been temporarily disabled." msgstr "" #: src/extmail.c:1274 msgid "Finding mail stats costs %d %s." msgstr "" #: src/extmail.c:1281 msgid "There are %d messages in the mail spool." msgstr "" #: src/extmail.c:1294 msgid "MAIL: There are %d msgs in the mail spool, %d unread, %d cleared." msgstr "" #: src/extmail.c:1312 msgid "MAIL: There are %d old msgs in the mail spool, totalling %d characters." msgstr "" #: src/extmail.c:1316 msgid "MAIL: There are %d new msgs in the mail spool, totalling %d characters." msgstr "" #: src/extmail.c:1320 msgid "MAIL: There are %d cleared msgs in the mail spool, totalling %d characters." msgstr "" #: src/extmail.c:1335 msgid "%s sent %d messages." msgstr "" #: src/extmail.c:1336 msgid "%s has %d messages." msgstr "" #: src/extmail.c:1365 msgid "Mail statistics for %s:" msgstr "" Locale-PO-0.23/t/RT40009.po0000644000175000017500000000123212104417253014237 0ustar cosimocosimo#, fuzzy msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: cosimo@opera.com\n" "POT-Creation-Date: 2012-09-03 14:03+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: test.html:1 #~ msgid "More info" #~ msgstr "" #~ "This is an obsolete string that appears to run over multiple lines and there is " #~ "nothing you can do to escape the simple fact that it does run over multiple lines." Locale-PO-0.23/t/subclass.t0000644000175000017500000000136012104417253014763 0ustar cosimocosimouse strict; use warnings; use Test::More 'no_plan'; use File::Slurp; my $pos = Locale::PO::Subclass->load_file_asarray("t/test.pot"); ok $pos, "loaded test.pot file"; my $out = $pos->[0]->dump; ok $out, "dumped po object"; is($pos->[1]->loaded_line_number, 16, "got line number of 2nd po entry"); ok Locale::PO::Subclass->save_file_fromarray( "t/test.pot.out", $pos ), "save to file"; ok -e "t/test.pot.out", "the file now exists"; is( read_file("t/test.pot"), read_file("t/test.pot.out"), "found no matches - good" ) && unlink("t/test.pot.out"); package Locale::PO::Subclass; use strict; use warnings; use base qw( Locale::PO ); sub custom_format { my $self = shift; return $self->_tri_value_flag('custom-format', @_); } 1; Locale-PO-0.23/t/fuzzy.t0000644000175000017500000000272312104417253014337 0ustar cosimocosimo# $Id: fuzzy.t,v 1.1 2011/02/28 14:33:10 evdb Exp $ # Copyright 2005. Distributed under the same licence as Perl itself. # Author: Joshua Miller use strict; use warnings; use Test::More 'no_plan'; use File::Slurp; use_ok 'Locale::PO'; my $pos = Locale::PO->load_file_asarray("t/fuzzy.pot"); ok $pos, "loaded fuzzy.pot file"; my $out = $pos->[0]->dump; ok $out, "dumped po object"; ok Locale::PO->save_file_fromarray( "t/fuzzy.pot.out", $pos ), "save to file"; ok -e "t/fuzzy.pot.out", "the file now exists"; is( read_file('t/fuzzy.pot'), read_file('t/fuzzy.pot.out'), "found no matches - good" ) && unlink 't/fuzzy.pot.out'; { # Check that the fuzzy can be created in code. my $po = Locale::PO->new( -fuzzy_msgid => 'one test', -fuzzy_msgid_plural => '%d tests', -msgid => '%d test', -msgid_plural => '%d tests', -msgstr_n => { 0 => '%d TEST', 1 => '%d TESTS' }, ); ok $po, "object created."; my $expected = join "\n", '#| msgid "one test"', '#| msgid_plural "%d tests"', 'msgid "%d test"', 'msgid_plural "%d tests"', 'msgstr[0] "%d TEST"', 'msgstr[1] "%d TESTS"', '', ''; is $po->dump, $expected, "check the output"; # try to edit the fuzzy in the code. ok $po->fuzzy_msgid( 'one TeSt' ), "change the value of a fuzzy msgid"; $expected =~ s/one test/one TeSt/; is $po->dump, $expected, "check the output"; } Locale-PO-0.23/t/plurals.t0000644000175000017500000000253012104417253014626 0ustar cosimocosimo# $Id: plurals.t,v 1.1 2005/10/17 22:14:52 evdb Exp $ # Copyright 2005. Distributed under the same licence as Perl itself. # Author: Edmund von der Burg use strict; use warnings; use Test::More 'no_plan'; use File::Slurp; use_ok 'Locale::PO'; my $pos = Locale::PO->load_file_asarray("t/plurals.pot"); ok $pos, "loaded plurals.pot file"; my $out = $pos->[0]->dump; ok $out, "dumped po object"; ok Locale::PO->save_file_fromarray( "t/plurals.pot.out", $pos ), "save to file"; ok -e "t/plurals.pot.out", "the file now exists"; is( read_file('t/plurals.pot'), read_file('t/plurals.pot.out'), "found no matches - good" ) && unlink 't/plurals.pot.out'; { # Check that the plurals can be created in code. my $po = Locale::PO->new( -msgid => '%d test', -msgid_plural => '%d tests', -msgstr_n => { 0 => '%d TEST', 1 => '%d TESTS' }, ); ok $po, "object created."; my $expected = join "\n", 'msgid "%d test"', 'msgid_plural "%d tests"', 'msgstr[0] "%d TEST"', 'msgstr[1] "%d TESTS"', '', ''; is $po->dump, $expected, "check the output"; # try to edit the plurals in the code. ok $po->msgstr_n( { 1 => '%d TeStS' } ), "change the value of a plurals translation"; $expected =~ s/TESTS/TeStS/; is $po->dump, $expected, "check the output"; } Locale-PO-0.23/t/fuzzy.pot0000644000175000017500000000362412104417253014677 0ustar cosimocosimomsgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" # tests for handline fuzzy / old strings #, fuzzy #| msgid "Click Ok to continue." msgid "Click OK to continue." msgstr "" #: cgi-bin/test.pl:6505 #, fuzzy #| msgid "Response" msgid "Add Response" msgstr "" #: cgi-bin/programGoals.pl:1200 #, fuzzy #| msgid "" #| "There are no bindings for the the Goal Group filter you chose. \n" #| "If you need a binding added contact %1. All Goal Groups, \n" #| "will still be displayed below." msgid "" "There are no bindings for the the Goal Group or GoalType Sets you chose.\n" "If you need a binding added contact %1. All Goal Groups and GoalType Sets\n" "will still be displayed below." msgstr "" #: cgi-bin/employeeProfile.pl:824 #, fuzzy #| msgctxt "Date as in the noun, the time at which an event occcurs" #| msgid "Date" msgctxt "Date as in the noun, the time at which an event occurred" msgid "Date" msgstr "" #, fuzzy #| msgid "1 day" #| msgid_plural "%n days" msgctxt "Number of Days" msgid "1 day" msgid_plural "%n days" msgstr[0] "" msgstr[1] "" #, fuzzy #~| msgid "Other Fields" #~ msgid "Other Skills" #~ msgstr "" #, fuzzy #~| msgid "" #~| "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do \n" #~| "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim \n" #~| "ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \n" #~| "aliquip ex ea commodo consequat. Duis aute irure dolor in \n" #~| "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla \n" #~| "pariatur. Excepteur sint occaecat cupidatat non proident, sunt in \n" #~| "culpa qui officia deserunt mollit anim id est laborum." #~ msgid "Lorem ipsum" #~ msgstr "" Locale-PO-0.23/t/utf-8.t0000755000175000017500000000207712104417254014121 0ustar cosimocosimo=head1 NAME t/utf-8.t =head1 DESCRIPTION Check that utf-8 files are read correctly https://rt.cpan.org/Public/Bug/Display.html?id=76366 =cut use strict; use warnings; use utf8; use Test::More; use File::Slurp; use Locale::PO; use Data::Dumper; my $file = "t/utf-8.po"; my $po = Locale::PO->load_file_asarray( $file, 'utf8' ); ok $po, "loaded ${file} file"; my $out = $po->[0]->dump; ok $out, "dumped po object"; ok(Locale::PO->save_file_fromarray( "${file}.out", $po, 'utf8' ), "save again to file"); ok -e "${file}.out", "the file now exists"; my $po_after_rt = Locale::PO->load_file_asarray( "${file}.out", 'utf8' ); ok $po_after_rt, "loaded ${file}.out file" and unlink "${file}.out"; my $orig_entry = $po->[1]; my $new_entry = $po_after_rt->[1]; is_deeply $orig_entry => $new_entry, "We have the same entry before and after a round trip"; is $new_entry->msgstr => q("Этот текст на русском (UTF-8)"), "Multiline obsolete strings are conserved"; ok utf8::is_utf8( $new_entry->msgstr ), "Entry is UTF-8 marked string"; done_testing(); Locale-PO-0.23/t/utf-8.po0000755000175000017500000000102612104417254014265 0ustar cosimocosimomsgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: cosimo@opera.com\n" "POT-Creation-Date: 2013-02-04 18:55+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" msgid "This is line in Russian (UTF-8)" msgstr "" "Этот текст на русском (UTF-8)" Locale-PO-0.23/t/test1.pot0000644000175000017500000000101412104417254014540 0ustar cosimocosimomsgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" # The entry below is # designed to test the ability of the comment fill code to properly wrap long comments as also to properly normalize the po entries. Apologies to Magritte. #, fuzzy msgid "This is not a pipe" msgstr "" Locale-PO-0.23/t/plurals.pot0000644000175000017500000000366012104417253015172 0ustar cosimocosimo# PledgeBank origianal .po file, autogenerated by gettext-extract. # Copyright (C) 2005 UK Citizens Online Democracy # This file is distributed under the same license as the main PledgeBank code. # Matthew Somerville , 2005-08-13. # # Shamelessly modified and then used as a test by Edmund von der Burg # (evdb@ecclestoad.co.uk) Translations are into 'bling'. # # $Id: plurals.pot,v 1.1 2005/10/17 22:14:52 evdb Exp $ # #, fuzzy msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: matthew@mysociety.org\n" "POT-Creation-Date: 2005-09-15 14:20+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: phplib/countries.php:17 msgid "Afghanistan" msgstr "" #: phplib/countries.php:18 msgid "Aland Islands" msgstr "" #: pb/phplib/pledge.php:267 msgid "Deadline to sign up by:" msgstr "" #: pb/phplib/pledge.php:272 #, php-format msgid "%s person signed up" msgid_plural "%s people signed up" msgstr[0] "" msgstr[1] "" #: pb/phplib/pledge.php:274 #, php-format msgid "%s person has signed up" msgid_plural "%s people have signed up" msgstr[0] "" msgstr[1] "" #: pb/phplib/pledge.php:277 #, php-format msgid "(%d over target)" msgstr "" #: pb/phplib/pledge.php:281 #, php-format msgid "%d more was needed" msgid_plural "%d more were needed" msgstr[0] "just %d more init" msgstr[1] "loads more man, %d init" #: pb/phplib/pledge.php:281 #, php-format #~ msgid "needed %d more" #~ msgid_plural "we needed %d more" #~ msgstr[0] "just %d more" #~ msgstr[1] "loads more man, %d" #: pb/phplib/pledge.php:283 #, php-format msgid "%d more needed" msgstr "" #: pb/phplib/pledge.php:310 msgid "More details" msgstr "" #: pb/phplib/pledge.php:310 #~ msgid "More info" #~ msgstr "" Locale-PO-0.23/t/singular.t0000644000175000017500000000365112104417253014775 0ustar cosimocosimouse strict; use warnings; # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' use Test::More 'no_plan'; use File::Slurp; use_ok 'Locale::PO'; my $po = new Locale::PO( -msgid => 'This is not a pipe', -msgstr => "", -comment => "The entry below is\ndesigned to test the ability of the comment fill code to properly wrap long comments as also to properly normalize the po entries. Apologies to Magritte.", -fuzzy => 1 ); ok $po, "got a po object"; my $out = $po->dump; ok $out, "dumped the po object"; my @po = $po; $po = new Locale::PO( -msgid => '', -msgstr => "Project-Id-Version: PACKAGE VERSION\\n" . "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\\n" . "Last-Translator: FULL NAME \\n" . "Language-Team: LANGUAGE \\n" . "MIME-Version: 1.0\\n" . "Content-Type: text/plain; charset=CHARSET\\n" . "Content-Transfer-Encoding: ENCODING\\n" ); ok @po, "got the array"; ok $po, "got the po object"; unshift @po, $po; ok Locale::PO->save_file_fromarray( "t/test1.pot.out", \@po ), "save file from array"; ok -e "t/test1.pot.out", "the file was created"; is( read_file("t/test1.pot"), read_file("t/test1.pot.out"), "found no matches - good" ) && unlink("t/test1.pot.out"); ################################################################################ # # Do some roundtrip tests. # my $pos = Locale::PO->load_file_asarray("t/test.pot"); ok $pos, "loaded test.pot file"; $out = $pos->[0]->dump; ok $out, "dumped po object"; is($pos->[1]->loaded_line_number, 16, "got line number of 2nd po entry"); ok Locale::PO->save_file_fromarray( "t/test.pot.out", $pos ), "save to file"; ok -e "t/test.pot.out", "the file now exists"; is( read_file("t/test.pot"), read_file("t/test.pot.out"), "found no matches - good" ) && unlink("t/test.pot.out"); Locale-PO-0.23/t/RT40009.t0000644000175000017500000000267612104417253014101 0ustar cosimocosimo=head1 NAME t/RT40009.t =head1 DESCRIPTION Check that obsolete multiline msgstr entries are recognized and stored correctly, as per RT#40009: https://rt.cpan.org/Ticket/Display.html?id=40009 =cut use strict; use warnings; use Test::More tests => 8; use File::Slurp; use Locale::PO; use Data::Dumper; my $file = "t/RT40009.po"; my $po = Locale::PO->load_file_asarray($file); ok $po, "loaded ${file} file"; my $out = $po->[0]->dump; ok $out, "dumped po object"; ok(Locale::PO->save_file_fromarray("${file}.out", $po), "save again to file"); ok -e "${file}.out", "the file now exists"; my $po_after_rt = Locale::PO->load_file_asarray("${file}.out"); ok $po_after_rt, "loaded ${file}.out file" and unlink "${file}.out"; # Check that our multiline obsolete msgstr is # still the same string, even if it might have changed # from multiple lines to single line internally # Old Locale::PO used to barf with "Strange line at ..." # See RT#40009, https://rt.cpan.org/Ticket/Display.html?id=40009 my $orig_entry = $po->[1]; my $new_entry = $po_after_rt->[1]; ok $new_entry->obsolete, "Entry is marked as obsolete"; is_deeply $orig_entry => $new_entry, "We have the same entry before and after a round trip"; is $new_entry->msgstr => q("This is an obsolete string that appears to run over multiple lines and there is nothing you can do to escape the simple fact that it does run over multiple lines."), "Multiline obsolete strings are conserved"; Locale-PO-0.23/Changes0000644000175000017500000000457112104417303014012 0ustar cosimocosimoRevision history for Perl extension Locale::PO. 0.23 Feb 06 2013 - Bugs RT#76366 and RT#54064 - Added encoding option. Now we can load & save PO files in any encoding, For example in 'utf8'. Added test about this. (patch by Perlover which based on patch from Zach) - Some code indenting inside. 0.22 Sep 03 2012 - New maintainer: Cosimo Streppone (COSIMO) - Bug RT#40009 Incorrect handling of multi-line obsolete entries (patch by Joshua Miller, test case by Cosimo Streppone) - Bug RT#66264 Added support for fuzzy string prefix "#|" and "#~|". (patch by Joshua Miller) 0.21 May 19 2008 - BUG #35939 - Locale::PO is now correctly subclassable (patch provided by Cosimo Streppone) 0.20 Mar 15 2008 - BUG #34110 - fixed a rather serious problem with the dist not building on anything but a Mac 0.19 Mar 14 2008 - FEATURE: Added msgctxt support (thanks to Kevin Scannell for the patch) 0.18 Mar 14 2008 - New maintainer: Ken Prows - BUG #33969: Fixed a problem with multi-line msgid_plural entries - BUG #18679: Obsolete entries (#~) are now preserved - API: The following methods are now private: load_file, save_file, normalize_str, dump_multi_comment Apologies to anyone using these (undocumented) methods. - FEATURE: Added "loaded_line_number" accessor which returns the line number that an entry started at in the loaded po file - FEATURE: Now preserves any flag encountered in a #~ comment - Expanded POD - Thanks to Kalle Olavi Niemitalo for help in making many of these changes 0.17 Tue May 22 12:07:00 CDT 2007 - Improved regexes in load_file to handle whitespace better. Suggested by Byron Hammond. 0.16 Mon Oct 17 11:00:00 GMT 2005 - Added support for msgid_plural and msgstr_n. Also tidied up tests. evdb@ecclestoad.co.uk 0.15 Sun Aug 13 15:34:00 CDT 2005 - Fix to output of flags by albert.fazli@gmail.com. 0.14 Wed Dec 08 09:35:01 CDT 2004 - #. comments can be multiline. Fix by Kevin Patrick Scannell. 0.13 Fri Nov 21 14:25:01 CDT 2004 - Fix to empty comment handling by Frank Ralf 0.12 Fri Oct 1 13:00:01 CDT 2004 - Fixes to multiline string handling by Michael Soegtrop. 0.11 Mon Jul 24 09:24:31 CDT 2000 - test.pl script no longer uses diff -B, which is nonportable. 0.10 Sun Jul 16 14:24:39 2000 - original version; created by Alan Schwartz Locale-PO-0.23/MANIFEST0000644000175000017500000000054712104420072013644 0ustar cosimocosimoChanges MANIFEST META.yml Module meta-data (added by MakeMaker) Makefile.PL lib/Locale/PO.pm README t/fuzzy.pot t/fuzzy.t t/RT40009.t t/RT40009.po t/plurals.pot t/plurals.t t/singular.t t/subclass.t t/test.pot t/test1.pot t/utf-8.po t/utf-8.t META.json Module JSON meta-data (added by MakeMaker) Locale-PO-0.23/lib/0000755000175000017500000000000012104420072013253 5ustar cosimocosimoLocale-PO-0.23/lib/Locale/0000755000175000017500000000000012104420072014452 5ustar cosimocosimoLocale-PO-0.23/lib/Locale/PO.pm0000644000175000017500000005764612104417534015361 0ustar cosimocosimopackage Locale::PO; use strict; use warnings; our $VERSION = '0.23'; use Carp; sub new { my $this = shift; my %options = @_; my $class = ref($this) || $this; my $self = {}; bless $self, $class; $self->_flags([]); $self->fuzzy_msgid($options{'-fuzzy_msgid'}) if defined($options{'-fuzzy_msgid'}); $self->fuzzy_msgid_plural($options{'-fuzzy_msgid_plural'}) if defined($options{'-fuzzy_msgid_plural'}); $self->msgid($options{'-msgid'}) if defined($options{'-msgid'}); $self->msgid_plural($options{'-msgid_plural'}) if defined($options{'-msgid_plural'}); $self->msgstr($options{'-msgstr'}) if defined($options{'-msgstr'}); $self->msgstr_n($options{'-msgstr_n'}) if defined($options{'-msgstr_n'}); $self->msgctxt($options{'-msgctxt'}) if defined($options{'-msgctxt'}); $self->fuzzy_msgctxt($options{'-fuzzy_msgctxt'}) if defined($options{'-fuzzy_msgctxt'}); $self->comment($options{'-comment'}) if defined($options{'-comment'}); $self->fuzzy($options{'-fuzzy'}) if defined($options{'-fuzzy'}); $self->automatic($options{'-automatic'}) if defined($options{'-automatic'}); $self->reference($options{'-reference'}) if defined($options{'-reference'}); $self->c_format(1) if defined($options{'-c-format'}); $self->c_format(1) if defined($options{'-c_format'}); $self->c_format(0) if defined($options{'-no-c-format'}); $self->c_format(0) if defined($options{'-no_c_format'}); $self->loaded_line_number($options{'-loaded_line_number'}) if defined($options{'-loaded_line_number'}); return $self; } sub fuzzy_msgctxt { my $self = shift; @_ ? $self->{'fuzzy_msgctxt'} = $self->quote(shift) : $self->{'fuzzy_msgctxt'}; } sub fuzzy_msgid { my $self = shift; @_ ? $self->{'fuzzy_msgid'} = $self->quote(shift) : $self->{'fuzzy_msgid'}; } sub fuzzy_msgid_plural { my $self = shift; @_ ? $self->{'fuzzy_msgid_plural'} = $self->quote(shift) : $self->{'fuzzy_msgid_plural'}; } sub msgctxt { my $self = shift; @_ ? $self->{'msgctxt'} = $self->quote(shift) : $self->{'msgctxt'}; } sub msgid { my $self = shift; @_ ? $self->{'msgid'} = $self->quote(shift) : $self->{'msgid'}; } sub msgid_plural { my $self = shift; @_ ? $self->{'msgid_plural'} = $self->quote(shift) : $self->{'msgid_plural'}; } sub msgstr { my $self = shift; @_ ? $self->{'msgstr'} = $self->quote(shift) : $self->{'msgstr'}; } sub msgstr_n { my $self = shift; if (@_) { my $hashref = shift; # check that we have a hashref. croak 'Argument to msgstr_n must be a hashref: { n => "string n", ... }.' unless ref($hashref) eq 'HASH'; # Check that the keys are all numbers. croak 'Keys to msgstr_n hashref must be numbers' if grep {m/\D/} keys %$hashref; # Quote all the values in the hashref. $self->{'msgstr_n'}{$_} = $self->quote($$hashref{$_}) for keys %$hashref; } return $self->{'msgstr_n'}; } sub comment { my $self = shift; @_ ? $self->{'comment'} = shift : $self->{'comment'}; } sub automatic { my $self = shift; @_ ? $self->{'automatic'} = shift : $self->{'automatic'}; } sub reference { my $self = shift; @_ ? $self->{'reference'} = shift : $self->{'reference'}; } sub obsolete { my $self = shift; @_ ? $self->{'obsolete'} = shift : $self->{'obsolete'}; } sub fuzzy { my $self = shift; if (@_) { my $value = shift; $value ? $self->add_flag('fuzzy') : $self->remove_flag('fuzzy'); } return $self->has_flag('fuzzy'); } sub c_format { my $self = shift; return $self->_tri_value_flag('c-format', @_); } sub php_format { my $self = shift; return $self->_tri_value_flag('php-format', @_); } sub _flags { my $self = shift; @_ ? $self->{'_flags'} = shift : $self->{'_flags'}; } sub _tri_value_flag { my $self = shift; my $flag_name = shift; if (@_) { # set or clear the flags my $value = shift; if (!defined($value) || $value eq "") { $self->remove_flag("$flag_name"); $self->remove_flag("no-$flag_name"); return undef; } elsif ($value) { $self->add_flag("$flag_name"); $self->remove_flag("no-$flag_name"); return 1; } else { $self->add_flag("no-$flag_name"); $self->remove_flag("$flag_name"); return 0; } } else { # check the flags return 1 if $self->has_flag("$flag_name"); return 0 if $self->has_flag("no-$flag_name"); return undef; } } sub add_flag { my ($self, $flag_name) = @_; push @{$self->_flags}, $flag_name; return; } sub remove_flag { my ($self, $flag_name) = @_; my @new_flags; foreach my $flag (@{$self->_flags}) { push @new_flags, $flag unless $flag eq $flag_name; } $self->_flags(\@new_flags); return; } sub has_flag { my ($self, $flag_name) = @_; foreach my $flag (@{$self->_flags}) { return 1 if $flag eq $flag_name; } return; } sub loaded_line_number { my $self = shift; @_ ? $self->{'loaded_line_number'} = shift : $self->{'loaded_line_number'}; } sub _normalize_str { my $self = shift; my $string = shift; my $dequoted = $self->dequote($string); # This isn't quite perfect, but it's fast and easy if ($dequoted =~ /(^|[^\\])(\\\\)*\\n./) { # Multiline my $output; my @lines; $output = '""' . "\n"; @lines = split(/\\n/, $dequoted, -1); my $lastline = pop @lines; # special treatment for this one foreach (@lines) { $output .= $self->quote("$_\\n") . "\n"; } $output .= $self->quote($lastline) . "\n" if $lastline ne ""; return $output; } else { # Single line return "$string\n"; } } sub _fuzzy_normalize_str { my $self = shift; my $string = shift; my $prefix = shift; my $normalized = $self->_normalize_str($string); # on newlines, start them with "#| " or "#~| " $normalized =~ s/\n"/\n$prefix"/g; return $normalized; } sub dump { my $self = shift; my $obsolete = $self->obsolete ? '#~ ' : ''; my $fuzzy_prefix = $self->obsolete ? '#~| ' : '#| '; my $dump; $dump = $self->_dump_multi_comment($self->comment, "# ") if ($self->comment); $dump .= $self->_dump_multi_comment($self->automatic, "#. ") if ($self->automatic); $dump .= $self->_dump_multi_comment($self->reference, "#: ") if ($self->reference); my $flags = ''; foreach my $flag (@{$self->_flags}) { $flags .= ", $flag"; } $dump .= "#$flags\n" if length $flags; $dump .= "${fuzzy_prefix}msgctxt " . $self->_fuzzy_normalize_str($self->fuzzy_msgctxt, $fuzzy_prefix) if $self->fuzzy_msgctxt; $dump .= "${fuzzy_prefix}msgid " . $self->_fuzzy_normalize_str($self->fuzzy_msgid, $fuzzy_prefix) if $self->fuzzy_msgid; $dump .= "${fuzzy_prefix}msgid_plural " . $self->_fuzzy_normalize_str($self->fuzzy_msgid_plural, $fuzzy_prefix) if $self->fuzzy_msgid_plural; $dump .= "${obsolete}msgctxt " . $self->_normalize_str($self->msgctxt) if $self->msgctxt; $dump .= "${obsolete}msgid " . $self->_normalize_str($self->msgid); $dump .= "${obsolete}msgid_plural " . $self->_normalize_str($self->msgid_plural) if $self->msgid_plural; $dump .= "${obsolete}msgstr " . $self->_normalize_str($self->msgstr) if $self->msgstr; if (my $msgstr_n = $self->msgstr_n) { $dump .= "${obsolete}msgstr[$_] " . $self->_normalize_str($$msgstr_n{$_}) for sort { $a <=> $b } keys %$msgstr_n; } $dump .= "\n"; return $dump; } sub _dump_multi_comment { my $self = shift; my $comment = shift; my $leader = shift; my $chopped = $leader; chop($chopped); my $result = $leader . $comment; $result =~ s/\n/\n$leader/g; $result =~ s/^$leader$/$chopped/gm; $result .= "\n"; return $result; } # Quote a string properly sub quote { my $self = shift; my $string = shift; return undef unless defined $string; $string =~ s/"/\\"/g; return "\"$string\""; } sub dequote { my $self = shift; my $string = shift; return undef unless defined $string; $string =~ s/^"(.*)"/$1/; $string =~ s/\\"/"/g; return $string; } sub save_file_fromarray { my $self = shift; $self->_save_file(0, @_); } sub save_file_fromhash { my $self = shift; $self->_save_file(1, @_); } sub _save_file { my $self = shift; my $ashash = shift; my $file = shift; my $entries = shift; my $encoding = shift; open(OUT, defined($encoding) ? ">:encoding($encoding)" : ">", $file) or return undef; if ($ashash) { foreach (sort keys %$entries) { print OUT $entries->{$_}->dump; } } else { foreach (@$entries) { print OUT $_->dump; } } close OUT; } sub load_file_asarray { my $self = shift; $self->_load_file(0, @_); } sub load_file_ashash { my $self = shift; $self->_load_file(1, @_); } sub _load_file { my $self = shift; my $ashash = shift; my $file = shift; my $encoding = shift; my $class = ref $self || $self; my (@entries, %entries); my $line_number = 0; my $po; my %buffer; my $last_buffer; open(IN, defined($encoding) ? "<:encoding($encoding)" : "<", $file) or return undef; while () { chop; $line_number++; if (/^$/) { # Empty line. End of an entry. if (defined($po)) { $po->fuzzy_msgctxt($buffer{fuzzy_msgctxt}) if defined $buffer{fuzzy_msgctxt}; $po->fuzzy_msgid($buffer{fuzzy_msgid}) if defined $buffer{fuzzy_msgid}; $po->fuzzy_msgid_plural($buffer{fuzzy_msgid_plural}) if defined $buffer{fuzzy_msgid_plural}; $po->msgctxt($buffer{msgctxt}) if defined $buffer{msgctxt}; $po->msgid($buffer{msgid}) if defined $buffer{msgid}; $po->msgid_plural($buffer{msgid_plural}) if defined $buffer{msgid_plural}; $po->msgstr($buffer{msgstr}) if defined $buffer{msgstr}; $po->msgstr_n($buffer{msgstr_n}) if defined $buffer{msgstr_n}; # ashash if ($ashash) { $entries{$po->msgid} = $po if ($po->_hash_key_ok(\%entries)); } # asarray else { push(@entries, $po); } undef $po; undef $last_buffer; %buffer = (); } } elsif (/^#\s+(.*)/ or /^#()$/) { # Translator comments $po = $class->new(-loaded_line_number => $line_number) unless defined($po); if (defined($po->comment)) { $po->comment($po->comment . "\n$1"); } else { $po->comment($1); } } elsif (/^#\.\s*(.*)/) { # Automatic comments $po = $class->new(-loaded_line_number => $line_number) unless defined($po); if (defined($po->automatic)) { $po->automatic($po->automatic . "\n$1"); } else { $po->automatic($1); } } elsif (/^#:\s+(.*)/) { # reference $po = $class->new(-loaded_line_number => $line_number) unless defined($po); if (defined($po->reference)) { $po->reference($po->reference . "\n$1"); } else { $po->reference($1); } } elsif (/^#,\s+(.*)/) { # flags my @flags = split /\s*[,]\s*/, $1; $po = $class->new(-loaded_line_number => $line_number) unless defined($po); foreach my $flag (@flags) { $po->add_flag($flag); } } elsif (/^#(~)?\|\s+msgctxt\s+(.*)/) { $po = $class->new(-loaded_line_number => $line_number) unless defined($po); $buffer{fuzzy_msgctxt} = $self->dequote($2); $last_buffer = \$buffer{fuzzy_msgctxt}; $po->obsolete(1) if $1; } elsif (/^#(~)?\|\s+msgid\s+(.*)/) { $po = $class->new(-loaded_line_number => $line_number) unless defined($po); $buffer{fuzzy_msgid} = $self->dequote($2); $last_buffer = \$buffer{fuzzy_msgid}; $po->obsolete(1) if $1; } elsif (/^#(~)?\|\s+msgid_plural\s+(.*)/) { $po = $class->new(-loaded_line_number => $line_number) unless defined($po); $buffer{fuzzy_msgid_plural} = $self->dequote($2); $last_buffer = \$buffer{fuzzy_msgid_plural}; $po->obsolete(1) if $1; } elsif (/^(#~\s+)?msgctxt\s+(.*)/) { $po = $class->new(-loaded_line_number => $line_number) unless defined($po); $buffer{msgctxt} = $self->dequote($2); $last_buffer = \$buffer{msgctxt}; $po->obsolete(1) if $1; } elsif (/^(#~\s+)?msgid\s+(.*)/) { $po = $class->new(-loaded_line_number => $line_number) unless defined($po); $buffer{msgid} = $self->dequote($2); $last_buffer = \$buffer{msgid}; $po->obsolete(1) if $1; } elsif (/^(#~\s+)?msgid_plural\s+(.*)/) { $po = $class->new(-loaded_line_number => $line_number) unless defined($po); $buffer{msgid_plural} = $self->dequote($2); $last_buffer = \$buffer{msgid_plural}; $po->obsolete(1) if $1; } elsif (/^(?:#~\s+)?msgstr\s+(.*)/) { # translated string $buffer{msgstr} = $self->dequote($1); $last_buffer = \$buffer{msgstr}; } elsif (/^(?:#~\s+)?msgstr\[(\d+)\]\s+(.*)/) { # translated string $buffer{msgstr_n}{$1} = $self->dequote($2); $last_buffer = \$buffer{msgstr_n}{$1}; } elsif (/^(?:#(?:~|~\||\|)\s+)?(".*)/) { # continued string. Accounts for: # normal : "string" # obsolete : #~ "string" # fuzzy : #| "string" # fuzzy+obsolete : #~| "string" $$last_buffer .= $self->dequote($1); } else { warn "Strange line at $file line $line_number: $_\n"; } } if (defined($po)) { $po->msgctxt($buffer{msgctxt}) if defined $buffer{msgctxt}; $po->msgid($buffer{msgid}) if defined $buffer{msgid}; $po->msgid_plural($buffer{msgid_plural}) if defined $buffer{msgid_plural}; $po->msgstr($buffer{msgstr}) if defined $buffer{msgstr}; $po->msgstr_n($buffer{msgstr_n}) if defined $buffer{msgstr_n}; # ashash if ($ashash) { if ($po->_hash_key_ok(\%entries)) { $entries{$po->msgid} = $po; } } # asarray else { push(@entries, $po); } } close IN; return ($ashash ? \%entries : \@entries); } sub _hash_key_ok { my ($self, $entries) = @_; my $key = $self->msgid; if ($entries->{$key}) { # don't overwrite non-obsolete entries with obsolete ones return if (($self->obsolete) && (not $entries->{$key}->obsolete)); # don't overwrite translated entries with untranslated ones return if (($self->msgstr !~ /\w/) && ($entries->{$key}->msgstr =~ /\w/)); } return 1; } # Autoload methods go after =cut, and are processed by the autosplit program. 1; __END__ # Below is the stub of documentation for your module. You better edit it! =head1 NAME Locale::PO - Perl module for manipulating .po entries from GNU gettext =head1 SYNOPSIS use Locale::PO; $po = new Locale::PO([-option=>value,...]) [$string =] $po->msgid([new string]); [$string =] $po->msgstr([new string]); [$string =] $po->comment([new string]); [$string =] $po->automatic([new string]); [$string =] $po->reference([new string]); [$value =] $po->fuzzy([value]); [$value =] $po->add_flag('c-format'); print $po->dump; $quoted_string = $po->quote($string); $string = $po->dequote($quoted_string); $aref = Locale::PO->load_file_asarray(,[encoding]); $href = Locale::PO->load_file_ashash(,[encoding]); Locale::PO->save_file_fromarray(,$aref,[encoding]); Locale::PO->save_file_fromhash(,$href,[encoding]); =head1 DESCRIPTION This module simplifies management of GNU gettext .po files and is an alternative to using emacs po-mode. It provides an object-oriented interface in which each entry in a .po file is a Locale::PO object. =head1 METHODS =over 4 =item new my Locale::PO $po = new Locale::PO; my Locale::PO $po = new Locale::PO(%options); Create a new Locale::PO object to represent a po entry. You can optionally set the attributes of the entry by passing a list/hash of the form: -option=>value, -option=>value, etc. Where options are msgid, msgid_plural, msgstr, msgctxt, comment, automatic, reference, fuzzy_msgctxt, fuzzy_msgid, fuzzy_msgid_plural, fuzzy, and c-format. See accessor methods below. To generate a po file header, add an entry with an empty msgid, like this: $po = new Locale::PO(-msgid=>'', -msgstr=> "Project-Id-Version: PACKAGE VERSION\\n" . "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\\n" . "Last-Translator: FULL NAME \\n" . "Language-Team: LANGUAGE \\n" . "MIME-Version: 1.0\\n" . "Content-Type: text/plain; charset=CHARSET\\n" . "Content-Transfer-Encoding: ENCODING\\n"); =item msgid Set or get the untranslated string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. =item msgid_plural Set or get the untranslated plural string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. =item msgstr Set or get the translated string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. =item msgstr_n Get or set the translations if there are purals involved. Takes and returns a hashref where the keys are the 'N' case and the values are the strings. eg: $po->msgstr_n( { 0 => 'found %d plural translations', 1 => 'found %d singular translation', } ); This method expects the new strings in unquoted form but returns the current strings in quoted form. =item msgctxt Set or get the translation context string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. =item fuzzy_msgid Set or get the outdated untranslated string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. =item fuzzy_msgid_plural Set or get the outdated untranslated plural string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. =item fuzzy_msgctxt Set or get the outdated translation context string from the object. This method expects the new string in unquoted form but returns the current string in quoted form. =item obsolete Returns 1 if the entry is obsolete. Obsolete entries have their msgid, msgid_plural, msgstr, msgstr_n and msgctxt lines commented out with "#~" When using load_file_ashash, non-obsolete entries will always replace obsolete entries with the same msgid. =item comment Set or get translator comments from the object. If there are no such comments, then the value is undef. Otherwise, the value is a string that contains the comment lines delimited with "\n". The string includes neither the S<"# "> at the beginning of each comment line nor the newline at the end of the last comment line. =item automatic Set or get automatic comments from the object (inserted by emacs po-mode or xgettext). If there are no such comments, then the value is undef. Otherwise, the value is a string that contains the comment lines delimited with "\n". The string includes neither the S<"#. "> at the beginning of each comment line nor the newline at the end of the last comment line. =item reference Set or get reference marking comments from the object (inserted by emacs po-mode or gettext). =item fuzzy Set or get the fuzzy flag on the object ("check this translation"). When setting, use 1 to turn on fuzzy, and 0 to turn it off. =item c_format Set or get the c-format or no-c-format flag on the object. This can take 3 values: 1 implies c-format, 0 implies no-c-format, and undefined implies neither. =item php_format Set or get the php-format or no-php-format flag on the object. This can take 3 values: 1 implies php-format, 0 implies no-php-format, and undefined implies neither. =item has_flag if ($po->has_flag('perl-format')) { ... } Returns true if the flag exists in the entry's #~ comment =item add_flag $po->add_flag('perl-format'); Adds the flag to the #~ comment =item remove_flag $po->remove_flag('perl-format'); Removes the flag from the #~ comment =item loaded_line_number When using one of the load_file_as* methods, this will return the line number that the entry started at in the file. =item dump Returns the entry as a string, suitable for output to a po file. =item quote Applies po quotation rules to a string, and returns the quoted string. The quoted string will have all existing double-quote characters escaped by backslashes, and will be enclosed in double quotes. =item dequote Returns a quoted po string to its natural form. =item load_file_asarray Given the filename of a po-file, reads the file and returns a reference to a list of Locale::PO objects corresponding to the contents of the file, in the same order. Accepts an optional encoding parameter (e.g. "utf8") which defines how the po-file's input stream will be configured. =item load_file_ashash Given the filename of a po-file, reads the file and returns a reference to a hash of Locale::PO objects corresponding to the contents of the file. The hash keys are the untranslated strings, so this is a cheap way to remove duplicates. The method will prefer to keep entries that have been translated. Accepts an optional encoding parameter (e.g. "utf8") which defines how the po-file's input stream will be configured. =item save_file_fromarray Given a filename and a reference to a list of Locale::PO objects, saves those objects to the file, creating a po-file. Accepts an optional encoding parameter (e.g. "utf8") which defines how the po-file's output stream will be configured. =item save_file_fromhash Given a filename and a reference to a hash of Locale::PO objects, saves those objects to the file, creating a po-file. The entries are sorted alphabetically by untranslated string. Accepts an optional encoding parameter (e.g. "utf8") which defines how the po-file's output stream will be configured. =back =head1 AUTHOR Maintainer: Ken Prows, perl@xev.net Original version by: Alan Schwartz, alansz@pennmush.org =head1 BUGS If you load_file_as* then save_file_from*, the output file may have slight cosmetic differences from the input file (an extra blank line here or there). msgid, msgid_plural, msgstr, msgstr_n and msgctxt expect a non-quoted string as input, but return quoted strings. I'm hesitant to change this in fear of breaking the modules/scripts of people already using Locale::PO. Locale::PO requires blank lines between entries, but Uniforum style PO files don't have any. Please submit all bug requests using CPAN's ticketing system. =head1 SEE ALSO xgettext(1). =cut Locale-PO-0.23/README0000644000175000017500000000105012104417253013370 0ustar cosimocosimoLocale::PO - Object-oriented interface to gettext po-file entries All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. DESCRIPTION This module provides methods for manipulating objects that represent entries in a gettext po-file (untranslated and translated strings, with associated comments). It can load and save complete po-files. PREREQUISITES Test::More, File::Slurp INSTALLATION perl Makefile.PL make make test make install Locale-PO-0.23/Makefile.PL0000644000175000017500000000053612104417253014472 0ustar cosimocosimouse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'Locale::PO', PREREQ_PM => { 'File::Slurp' => 0, 'Test::More' => 0, }, ABSTRACT_FROM => 'lib/Locale/PO.pm', VERSION_FROM => 'lib/Locale/PO.pm', ); Locale-PO-0.23/META.yml0000664000175000017500000000077312104420072013767 0ustar cosimocosimo--- abstract: 'Perl module for manipulating .po entries from GNU gettext' author: - unknown build_requires: ExtUtils::MakeMaker: 0 configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Locale-PO no_index: directory: - t - inc requires: File::Slurp: 0 Test::More: 0 version: 0.23 Locale-PO-0.23/META.json0000664000175000017500000000161712104420072014135 0ustar cosimocosimo{ "abstract" : "Perl module for manipulating .po entries from GNU gettext", "author" : [ "unknown" ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Locale-PO", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "File::Slurp" : "0", "Test::More" : "0" } } }, "release_status" : "stable", "version" : "0.23" }