From a53eb5e0d2fa5be5639386a3cfe713df8c0c5333 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Tue, 12 Feb 2013 18:29:13 +0000 Subject: [PATCH 01/18] begin transition from English to ISO-639 with #234 This patch converts all English language strings used within depressionbot's localisation interface (that is, strings.json) to their ISO-639-1 equivalents. The purpose of this patch is to make the strings.json file less English-dependent. All languages with an ISO-639-1 code have been converted; that is, English, Spanish and Welsh, to ``en``, ``es`` and ``cy`` respectively. This patch does not attempt to force a solution to the issue of Na'vi: the language does not have a large enough corpus to warrant its own ISO 639-3 code, and as such there is no perfect solution. For the time being, this patch keeps the Na'vi language as its English language string ("Na'vi"). A possible solution to this discrepancy includes using the ISO 639-3 code ``art``, used for artificial languages that do not qualify for an official code, or by using local use codes specified in ISO 639-3 (qaa to qtz). This patch requires collaboration with upstream repositories that also use strings.json, such as the Github and Stats modules. --- config.json.sample | 2 +- modules/admin/strings.json | 74 ++++++++++----------- modules/command/strings.json | 20 +++--- modules/ignore/strings.json | 52 +++++++-------- modules/kick/strings.json | 12 ++-- modules/link/strings.json | 6 +- modules/poll/strings.json | 82 +++++++++++------------ modules/quotes/strings.json | 118 +++++++++++++++++----------------- modules/rain/strings.json | 88 ++++++++++++------------- modules/report/strings.json | 8 +-- modules/spelling/strings.json | 12 ++-- modules/users/strings.json | 12 ++-- 12 files changed, 243 insertions(+), 243 deletions(-) diff --git a/config.json.sample b/config.json.sample index 7ebd6af..1f1501e 100644 --- a/config.json.sample +++ b/config.json.sample @@ -14,7 +14,7 @@ "admins": [ "batman" ], "moderators": [ "whatever" ], "moduleNames": [ "ignore", "admin", "command", "dice", "js", "kick", "quotes", "spelling", "youare", "stats", "users" ], - "language": "english", + "language": "en", "debugMode": true, "version": "Depressionbot IRC bot 0.4-dev - Lovingly crafted by The DepressionBot Foundation (a charity arm of the Official Aberystwyth Open Source International Development League)." } diff --git a/modules/admin/strings.json b/modules/admin/strings.json index 272b72a..cd8c8ec 100644 --- a/modules/admin/strings.json +++ b/modules/admin/strings.json @@ -1,84 +1,84 @@ { "join": { - "english": "Joined {channel}", - "spanish" : "Entrado en {channel}", + "en": "Joined {channel}", + "es" : "Entrado en {channel}", "na'vi": "fpxäkìm {channel}(nemfa)", - "welsh": "Wedi ymuno {channel}" + "cy": "Wedi ymuno {channel}" }, "part": { - "english": "Left {channel}", - "spanish" : "Abandonada {channel}", + "en": "Left {channel}", + "es" : "Abandonada {channel}", "na'vi": "Hum {channel}", - "welsh": "Wedi gadael {channel}" + "cy": "Wedi gadael {channel}" }, "gpull": { - "english": "Git pulled that shit.", - "spanish": "Hecho git pull en esta mierda.", + "en": "Git pulled that shit.", + "es": "Hecho git pull en esta mierda.", "na'vi": "Gìtìl fì'uti stamarsìm.", - "welsh": "Wedi tynnu git yr cach na i gyd" + "cy": "Wedi tynnu git yr cach na i gyd" }, "reload": { - "english": "Reloaded that shit.", - "spanish": "Recargado esta mierda.", + "en": "Reloaded that shit.", + "es": "Recargado esta mierda.", "na'vi": "Oel fìuti stìyeftxaw.", - "welsh": "Ail-lwytho'r cach na" + "cy": "Ail-lwytho'r cach na" }, "load_module": { - "english": "Loaded new module: {moduleName}", - "spanish": "Cargado módulo nuevo: {moduleName}", + "en": "Loaded new module: {moduleName}", + "es": "Cargado módulo nuevo: {moduleName}", "na'vi": "Oel {moduleName}it amip stìyeftxaw.", - "welsh": "Wedi llwytho modiwl newydd: {moduleName}" + "cy": "Wedi llwytho modiwl newydd: {moduleName}" }, "unload_module": { - "english": "Turned off module: {moduleName}", - "spanish": "Descargado módulo: {moduleName}", + "en": "Turned off module: {moduleName}", + "es": "Descargado módulo: {moduleName}", "na'vi": "Oel {moduleName} tswìya'.", - "welsh": "Wedi troi ffwrdd y modiwl: {moduleName}" + "cy": "Wedi troi ffwrdd y modiwl: {moduleName}" }, "unload_error": { - "english": "{moduleName} isn't loaded. Idiot.", - "spanish": "{moduleName} no está cargado. Idiota.", + "en": "{moduleName} isn't loaded. Idiot.", + "es": "{moduleName} no está cargado. Idiota.", "na'vi": "Oel {moduleName}it omum. Nga skxawng lu.", - "welsh": "Di {moduleName} ddim wedi llwytho. Twpsyn" + "cy": "Di {moduleName} ddim wedi llwytho. Twpsyn" }, "banned": { - "english": "{user} banned from {command}", - "spanish": "{user} está prohibido de usar {command}", + "en": "{user} banned from {command}", + "es": "{user} está prohibido de usar {command}", "na'vi": "{command}ìri {user} ke tung.", - "welsh": "{user} wedi ei gohurio o {command}" + "cy": "{user} wedi ei gohurio o {command}" }, "unbanned": { - "english": "{user} unbanned from {command}", - "spanish": "{user} no está prohibido de user {command}", + "en": "{user} unbanned from {command}", + "es": "{user} no está prohibido de user {command}", "na'vi": "{command}ìri {user} tung set.", - "welsh": "{user} wedi ei dad-wahardd o {command}" + "cy": "{user} wedi ei dad-wahardd o {command}" }, "unban_error": { - "english": "{user} wasn't banned from that command, fool.", - "spanish": "{user} no fue prohibido de esta instrucción, tont@.", + "en": "{user} wasn't banned from that command, fool.", + "es": "{user} no fue prohibido de esta instrucción, tont@.", "na'vi": "{user} fìtsu'oti tamung srekrr, nga skxawng lu.", - "welsh": "Nid oedd {user} wedi ei wahardd o'r gyrchymun yna, fŵl" + "cy": "Nid oedd {user} wedi ei wahardd o'r gyrchymun yna, fŵl" }, "qlock": { - "english": "Locked quote category: {category}", - "spanish": "Cerrado la categoría: {category}", + "en": "Locked quote category: {category}", + "es": "Cerrado la categoría: {category}", "na'vi": "{category}ìri oel 'upxareti fmoli", - "welsh": "Categori wedi cloi: {category}" + "cy": "Categori wedi cloi: {category}" }, "already_in_channel": { - "english": "I'm already in {channel}", + "en": "I'm already in {channel}", "na'vi": "Oel {channel}it tok li" }, "not_in_channel": { - "english": "I'm not in {channel}", + "en": "I'm not in {channel}", "na'vi": "Oel {channel}it ke tok" }, "already_loaded_web": { - "english": "WHY CAN'T I LOAD ALL THIS WEB? (web already loaded)", + "en": "WHY CAN'T I LOAD ALL THIS WEB? (web already loaded)", "na'vi": "PELUN OEL KE TSUN OMUM FÌWETIT NÌWOTX (wetìri oe omum li)" }, "already_loaded": { - "english": "{moduleName} is already loaded.", + "en": "{moduleName} is already loaded.", "na'vi": "Oel omum teri {moduleName}it li." } } diff --git a/modules/command/strings.json b/modules/command/strings.json index 511c51e..676532e 100644 --- a/modules/command/strings.json +++ b/modules/command/strings.json @@ -1,30 +1,30 @@ { "command_ban": { - "english": "{user} is banned from using this command. Commence incineration.", - "spanish": "{user} está prohibido de usar esta instrucción. Comenzar incineración.", + "en": "{user} is banned from using this command. Commence incineration.", + "es": "{user} está prohibido de usar esta instrucción. Comenzar incineración.", "na'vi": "Tsu'ori {user} ke tung. Nga skxawng lu.", - "welsh": "Mae {user} wedi ei gohurio gan ddefnyddio'r gorchymun yma. Cychwyn orfflosgiad" + "cy": "Mae {user} wedi ei gohurio gan ddefnyddio'r gorchymun yma. Cychwyn orfflosgiad" }, "syntax_error": { - "english": "Invalid syntax. Initiate incineration.", - "spanish": "Sintaxis no válida. Iniciar incineración.", + "en": "Invalid syntax. Initiate incineration.", + "es": "Sintaxis no válida. Iniciar incineración.", "na'vi": "Ngeyä pamrel keyawr lu. Nga skxawng lu.", - "welsh": "Cystrawen annilys. Cychwyn orfflosgiad" + "cy": "Cystrawen annilys. Cychwyn orfflosgiad" }, "usage": { - "english": "Usage for {command}: {usage}.", + "en": "Usage for {command}: {usage}.", "na'vi": "Nga tsun sivar ìlä {command}: {usage}." }, "no_usage_info": { - "english": "No usage information found for {command}.", + "en": "No usage information found for {command}.", "na'vi": "Oel ke tsun sivar {comamnd}it" }, "help_link": { - "english": "Help for {module}: {link}", + "en": "Help for {module}: {link}", "na'vi": "{module}ä srungìl {link} it tok" }, "no_help": { - "english": "No help found for {module}.", + "en": "No help found for {module}.", "na'vi": "Fì{module}ìri oel ke tsun run srungit" } } diff --git a/modules/ignore/strings.json b/modules/ignore/strings.json index 7b31d66..8202cb0 100644 --- a/modules/ignore/strings.json +++ b/modules/ignore/strings.json @@ -1,64 +1,64 @@ { "ignore_usage": { - "english": "{user}: Usage: ~ignore [module]. Modules you can ignore are: {modules}.", - "spanish": "{user}: Modo de empleo: ~ignore [módulo]. Módulos que tú puedes ignorar son: {modules}.", + "en": "{user}: Usage: ~ignore [module]. Modules you can ignore are: {modules}.", + "es": "{user}: Modo de empleo: ~ignore [módulo]. Módulos que tú puedes ignorar son: {modules}.", "na'vi": "{user}: Sar: ~ignore ['u]. U, nga ke tìng mikyun: {modules}.", - "welsh": "{user}: Defnydd: ~ignore [modiwl]. Modiwlau a allech anwybyddu yw: {modules}." + "cy": "{user}: Defnydd: ~ignore [modiwl]. Modiwlau a allech anwybyddu yw: {modules}." }, "already_ignoring": { - "english": "{user}: You're already ignoring that module.", - "spanish": "{user}: Ya ignoras este módulo.", + "en": "{user}: You're already ignoring that module.", + "es": "{user}: Ya ignoras este módulo.", "na'vi": "{user}: 'uri nga ke tìng mikyun srekrr.", - "welsh": "{user}: Mi rwyt ti'n anwybyddu'r modiwl yna'n barod." + "cy": "{user}: Mi rwyt ti'n anwybyddu'r modiwl yna'n barod." }, "ignored": { - "english": "{user}: Now ignoring {module}.", - "spanish": "{user}: Estás ignorando {module}.", + "en": "{user}: Now ignoring {module}.", + "es": "{user}: Estás ignorando {module}.", "na'vi": "{user}: Nga ke terìng mikyun {module}ne set.", - "welsh": "{user}: Nawr yn anwybyddu {module}" + "cy": "{user}: Nawr yn anwybyddu {module}" }, "invalid_ignore": { - "english": "{user}: That isn't a valid module name.", - "spanish": "{user}: Ese no es un nombre de un módulo valido.", + "en": "{user}: That isn't a valid module name.", + "es": "{user}: Ese no es un nombre de un módulo valido.", "na'vi": "{user}: Tsatstxo eyawr ke lu.", - "welsh": "{user}: Nid oedd hwna'n modiwl dilys" + "cy": "{user}: Nid oedd hwna'n modiwl dilys" }, "unignore_usage": { - "english": "{user}: Usage: ~unignore [module]. Modules you are currently ignoring: {modules}.", - "spanish": "{user}: Modo de empleo: ~unignore [módulo]. Módulos que ignoras ahora mismo: {modules}.", + "en": "{user}: Usage: ~unignore [module]. Modules you are currently ignoring: {modules}.", + "es": "{user}: Modo de empleo: ~unignore [módulo]. Módulos que ignoras ahora mismo: {modules}.", "na'vi": "{user}: Sar: ~unignore ['u]. Uri, nga ke terìng mikyun: {modules}.", - "welsh": "{user}: Defnydd ~unignore [modiwl]. Modiwlau rydech yn anwybyddu ar hyn o bryd: {modules}" + "cy": "{user}: Defnydd ~unignore [modiwl]. Modiwlau rydech yn anwybyddu ar hyn o bryd: {modules}" }, "invalid_unignore": { - "english": "{user}: You're not ignoring that module or it doesn't exist.", - "spanish": "{user}: No ignoras este módulo o no existe.", + "en": "{user}: You're not ignoring that module or it doesn't exist.", + "es": "{user}: No ignoras este módulo o no existe.", "na'vi":"{user}: Nga terìng mikyun fu fì'ul fìtsengit ke tok.", - "welsh": "{user}: Nid wyt ti'n anwybyddu'r modiwl yna neu nid yw e'n bodoli" + "cy": "{user}: Nid wyt ti'n anwybyddu'r modiwl yna neu nid yw e'n bodoli" }, "unignored": { - "english": "{user}: No longer ignoring {module}.", - "spanish": "{user}: Ya no ignoras {module}.", + "en": "{user}: No longer ignoring {module}.", + "es": "{user}: Ya no ignoras {module}.", "na'vi": "{user}: Nga terìng mikyun {module}ne set", - "welsh": "{user}: Ddim yn anwybyddu {module} bellach" + "cy": "{user}: Ddim yn anwybyddu {module} bellach" }, "ignoring_channel": { - "english": "Now ignoring {module} in {channel}", + "en": "Now ignoring {module} in {channel}", "na'vi": "Oe ke stayawm {module}ur mì {channel}" }, "already_ignoring_channel": { - "english": "Already ignoring {module} in {channel}", + "en": "Already ignoring {module} in {channel}", "na'vi": "Oe ke stayawm {module}ur mì {channel} li" }, "module_not_exist": { - "english": "{module} isn't loaded or doesn't exist.", + "en": "{module} isn't loaded or doesn't exist.", "na'vi": "Oel ke omum teri {module}it fu {module} ke fkeytok" }, "unignoring_channel": { - "english": "No longer ignoring {module} in {channel}", + "en": "No longer ignoring {module} in {channel}", "na'vi": "Oel stayawm {module}ur mì {channel} set." }, "not_ignoring_channel": { - "english": "{module} wasn't being ignored in {channel}", + "en": "{module} wasn't being ignored in {channel}", "na'vi": "Oel stayawm {module}ur mì {channel} li." } } diff --git a/modules/kick/strings.json b/modules/kick/strings.json index 0fe8376..5c11a74 100644 --- a/modules/kick/strings.json +++ b/modules/kick/strings.json @@ -1,14 +1,14 @@ { "user_kicks": { - "english": "{user} has been kicked {kicks} times and has kicked people {kicked} times.", - "spanish": "Se ha expulsado {user} {kicks} veces y {user} ha expulsado personas {kicked} veces.", + "en": "{user} has been kicked {kicks} times and has kicked people {kicked} times.", + "es": "Se ha expulsado {user} {kicks} veces y {user} ha expulsado personas {kicked} veces.", "na'vi": "Tuteol {user}it tsrame'i {kicks} hìmtxan ulte sute tsrame'i {kicked} hìmtxan.", - "welsh": "Cafwyd {user} ei gicio {kicks} gwaith ac wedi cicio pobl {kicked} gwaith." + "cy": "Cafwyd {user} ei gicio {kicks} gwaith ac wedi cicio pobl {kicked} gwaith." }, "kicked_dbot": { - "english": "Thou shalt not kick {botname}", - "spanish": "No expulsás {botname}", + "en": "Thou shalt not kick {botname}", + "es": "No expulsás {botname}", "na'vi": "Ngal {botname}it ke tsun tsrive'i", - "welsh": "Ni ddylech cicio {botname}" + "cy": "Ni ddylech cicio {botname}" } } diff --git a/modules/link/strings.json b/modules/link/strings.json index 935e635..a89c9e5 100644 --- a/modules/link/strings.json +++ b/modules/link/strings.json @@ -1,12 +1,12 @@ { "title_not_found": { - "english": "No page title found.", + "en": "No page title found.", "na'vi": "Oel ke tsun run 'upxare atxin." }, "xkcd": { - "english": "xkcd {num}: {title} https://xkcd.com/{num}" + "en": "xkcd {num}: {title} https://xkcd.com/{num}" }, "no-hits": { - "english": "No hits." + "en": "No hits." } } diff --git a/modules/poll/strings.json b/modules/poll/strings.json index 412c3ec..7e76d92 100644 --- a/modules/poll/strings.json +++ b/modules/poll/strings.json @@ -1,87 +1,87 @@ { "newpoll_usage": { - "english": "Usage: ~newpoll name [options=opt1,opt2,opt3] description", - "spanish" : "Modo de empleo: ~newpoll nombre [options=opción1,opción2,opción3] descripción", + "en": "Usage: ~newpoll name [options=opt1,opt2,opt3] description", + "es" : "Modo de empleo: ~newpoll nombre [options=opción1,opción2,opción3] descripción", "na'vi": "Usage: ~newpoll tstxo [sìftxey=tìfxey1,tìfxey2,fìfxey3] tìsla'tsu", - "welsh": "Defnydd: ~newpoll enw [optiynau=opt1,opt2,op3] disgrifiad" + "cy": "Defnydd: ~newpoll enw [optiynau=opt1,opt2,op3] disgrifiad" }, "poll_exists": { - "english": "Poll '{name}' already exists.", - "spanish" : "Votación '{name}' ya existe.", + "en": "Poll '{name}' already exists.", + "es" : "Votación '{name}' ya existe.", "na'vi": "sìpawm sna'o '{name}' fkeytok srekrr.", - "welsh": "Mae'r pôl {name} bodoli'n barod" + "cy": "Mae'r pôl {name} bodoli'n barod" }, "poll_created": { - "english": "Poll '{name}' created ({description}). Cast thy votations! - {url}", - "spanish" : "Votación '{name}' creado ({description}). ¡Emited sus votas! - {url}", + "en": "Poll '{name}' created ({description}). Cast thy votations! - {url}", + "es" : "Votación '{name}' creado ({description}). ¡Emited sus votas! - {url}", "na'vi": "sìpawm sna'o '{name}' ngìyop ({description}). Nga tìpe'unit Pe'eiun - {url}" }, "poll_describe": { - "english": "{name}: {description} - {url}." + "en": "{name}: {description} - {url}." }, "changed_vote": { - "english": "{user} changed their vote in {poll} to '{vote}' ({count}).", - "spanish" : "{user} cambió su voto en {poll} a '{vote}' ({count}).", + "en": "{user} changed their vote in {poll} to '{vote}' ({count}).", + "es" : "{user} cambió su voto en {poll} a '{vote}' ({count}).", "na'vi": "{user} lìyatem ngeyä tìpe'un {poll}mì, ngeyä tìpe'un amip '{vote}'({count}) lu.", - "welsh": "Newidiodd {user} eu pleidlais yn {poll} i '{vote}' ({count})." + "cy": "Newidiodd {user} eu pleidlais yn {poll} i '{vote}' ({count})." }, "voted": { - "english": "{user} voted for '{vote}' in {poll} ({count}).", - "spanish" : "{user} votó para '{vote}' en {poll} ({count}).", + "en": "{user} voted for '{vote}' in {poll} ({count}).", + "es" : "{user} votó para '{vote}' en {poll} ({count}).", "na'vi": "'{vote}'ìri {user} pìye'un {poll}mì ({count}).", - "welsh": "Pledleisiodd {user} am '{vote}' yn {poll} ({count})." + "cy": "Pledleisiodd {user} am '{vote}' yn {poll} ({count})." }, "invalid_vote": { - "english": "Invalid vote: {vote}", - "spanish" : "Vota inválida: {vote}", + "en": "Invalid vote: {vote}", + "es" : "Vota inválida: {vote}", "na'vi": "Ngeyä tìpe'un keyawr lu ({vote}).", - "welsh": "Pleidlais annilys: {vote}" + "cy": "Pleidlais annilys: {vote}" }, "poll_unexistent": { - "english": "Poll '{name}' doesn't exist.", - "spanish" : "Votación '{name}' no existe.", + "en": "Poll '{name}' doesn't exist.", + "es" : "Votación '{name}' no existe.", "na'vi": "sìpawm sna'o '{name}' ke fkeytok.", - "welsh": "Nid yw pôl '{name}' yn bodoli" + "cy": "Nid yw pôl '{name}' yn bodoli" }, "option_added": { - "english": "{user}: '{option}' added to '{name}'.", - "spanish" : "{user}: '{option}' añadido a '{name}'.", + "en": "{user}: '{option}' added to '{name}'.", + "es" : "{user}: '{option}' añadido a '{name}'.", "na'vi": "'{name}'ur {user}ìl '{option}'it sung.", - "welsh": "{user}: Ychwanegwyd '{option}' i '{name}'" + "cy": "{user}: Ychwanegwyd '{option}' i '{name}'" }, "option_exists": { - "english": "{user}: '{option}' already exists in '{name}'.", - "spanish" : "{user}: '{option}' ya existe en '{name}'.", + "en": "{user}: '{option}' already exists in '{name}'.", + "es" : "{user}: '{option}' ya existe en '{name}'.", "na'vi": "{user}: '{option}' fkeytok srekrr '{name}'mì.", - "welsh": "{user}: Mae '{option}' yn bodoli'n barod yn '{name}'." + "cy": "{user}: Mae '{option}' yn bodoli'n barod yn '{name}'." }, "not_poll_owner": { - "english": "{user}: You don't own the '{name}' poll.", - "spanish" : "{user}: La votación '{name}' no es tuyo.", + "en": "{user}: You don't own the '{name}' poll.", + "es" : "{user}: La votación '{name}' no es tuyo.", "na'vi": "{user}: ngaru '{name}' sìpawm sna'o ke lu.", - "welsh": "{user}: Nid ydech chi'n berchen y pôl '{name}'." + "cy": "{user}: Nid ydech chi'n berchen y pôl '{name}'." }, "option_removed": { - "english": "{user}: '{option}' removed from '{name}'", - "spanish" : "{user}: '{option}' eliminado de '{name}'", + "en": "{user}: '{option}' removed from '{name}'", + "es" : "{user}: '{option}' eliminado de '{name}'", "na'vi": "{user}: '{option}'it 'aku '{name}'ta", - "welsh": "{user}: '{option}' wedi ei ddileu o '{name}'" + "cy": "{user}: '{option}' wedi ei ddileu o '{name}'" }, "av_voted": { - "english": "{user} voted '{vote}' in {poll}.", - "spanish": "{user} votó '{vote}' en {poll}.", + "en": "{user} voted '{vote}' in {poll}.", + "es": "{user} votó '{vote}' en {poll}.", "na'vi": "{user}ìl '{vote}'it pìye'un '{poll}'mì.", - "welsh": "Pledleisiodd {user} am '{vote}' yn {poll}" + "cy": "Pledleisiodd {user} am '{vote}' yn {poll}" }, "av_changed_vote": { - "english": "{user} changed their vote in {poll} to '{vote}'.", - "spanish" : "{user} cambió su voto en {poll} a '{vote}'.", + "en": "{user} changed their vote in {poll} to '{vote}'.", + "es" : "{user} cambió su voto en {poll} a '{vote}'.", "na'vi": "{user}ìl lìyatem ngeyä tìpa'unit '{poll}'mì, ngeyä tìpe'un '{vote} lu set.", - "welsh": "Newidiodd {user} eu pleidlais yn {poll} i '{vote}'" + "cy": "Newidiodd {user} eu pleidlais yn {poll} i '{vote}'" }, "count": { - "english": "The running-order of poll '{poll}' ({description}) is: {places}.", + "en": "The running-order of poll '{poll}' ({description}) is: {places}.", "na'vi": "Sute tsnì pole'un '{poll}'mì ({description}) lu: {places}.", - "welsh": "Trefn yr pôl '{poll}' ({description}) yw: {places}" + "cy": "Trefn yr pôl '{poll}' ({description}) yw: {places}" } } diff --git a/modules/quotes/strings.json b/modules/quotes/strings.json index 3d3a9c1..5c3d3d3 100644 --- a/modules/quotes/strings.json +++ b/modules/quotes/strings.json @@ -1,130 +1,130 @@ { "category_not_found": { - "english": "Nobody loves {category}", - "spanish": "Nadie ama a {category}", + "en": "Nobody loves {category}", + "es": "Nadie ama a {category}", "na'vi": "{category} yawne ke lu kawturu.", - "welsh": "Does neb yn caru {category}" + "cy": "Does neb yn caru {category}" }, "large_categories": { - "english": "Largest categories: ", - "spanish": "Los categorías más grandes: ", + "en": "Largest categories: ", + "es": "Los categorías más grandes: ", "na'vi": "U atsawl: ", - "welsh": "Categoriau mwyaf: " + "cy": "Categoriau mwyaf: " }, "empty_category": { - "english": "That category has no quotes in. Commence incineration.", - "spanish": "Categoría vacía. Iniciar incineración.", + "en": "That category has no quotes in. Commence incineration.", + "es": "Categoría vacía. Iniciar incineración.", "na'vi": "Tsauru upxare lu. Nga skxawng lu.", - "welsh": "Nid yw'r categori yna efo dyfyniadau. Cychwyn orfflosgiad" + "cy": "Nid yw'r categori yna efo dyfyniadau. Cychwyn orfflosgiad" }, "no_results": { - "english": "No results found.", - "spanish": "No hubo ningún resultado.", + "en": "No results found.", + "es": "No hubo ningún resultado.", "na'vi": "Oel kea humit rìmun", - "welsh": "Dim canlyniadau ar gael" + "cy": "Dim canlyniadau ar gael" }, "locked_category": { - "english": "{category} is locked. Commence incineration.", - "spanish": "{category} está cerrada. Comenzar incineración.", + "en": "{category} is locked. Commence incineration.", + "es": "{category} está cerrada. Comenzar incineración.", "na'vi": "{category} ke fkeytok set. Nga skxawng lu nafì'u", - "welsh": "Mae {category} wedi cloi. Cychwyn orfflosgiad" + "cy": "Mae {category} wedi cloi. Cychwyn orfflosgiad" }, "no_quotes": { - "english": "No quotes exist under {category}", - "spanish": "Ninguna cita existe en {category}", + "en": "No quotes exist under {category}", + "es": "Ninguna cita existe en {category}", "na'vi": "Kea upxare fkeytok {category}mì", - "welsh": "Does dim dyfyniadau gan {category}" + "cy": "Does dim dyfyniadau gan {category}" }, "last_removed": { - "english": "Last quote removed from {category}.", - "spanish": "Última cita quitado de {category}.", + "en": "Last quote removed from {category}.", + "es": "Última cita quitado de {category}.", "na'vi": "Oel 'upxareti aham 'aku {category}ta", - "welsh": "Dyfyniad olaf wedi ei ddileu o {category}" + "cy": "Dyfyniad olaf wedi ei ddileu o {category}" }, "no_recent_adds": { - "english": "No quotes were added recently.", - "spanish": "Ninguna cita fue añadido recientamente.", + "en": "No quotes were added recently.", + "es": "Ninguna cita fue añadido recientamente.", "na'vi": "Kea upxareti samung nìfkrr", - "welsh": "Nid oes unrhyw dyfyniadau wedi ei ychwwanegu'n ddiweddar" + "cy": "Nid oes unrhyw dyfyniadau wedi ei ychwwanegu'n ddiweddar" }, "rmlast_spam": { - "english": "No spamming that shit. Try again in a few minutes...", - "spanish": "No me inundes de mierda. Intenta otra vez en unos minutos...", + "en": "No spamming that shit. Try again in a few minutes...", + "es": "No me inundes de mierda. Intenta otra vez en unos minutos...", "na'vi": "Nga Tsasngelit ke zene fpivere'. Sweylu nga fmivi ye'rìn...", - "welsh": "Peidiwch a sbamio hwna. Triwch eto mewn ychydyg funudau..." + "cy": "Peidiwch a sbamio hwna. Triwch eto mewn ychydyg funudau..." }, "removed_from": { - "english": "'{quote}' removed from {category}", - "spanish": "'{quote}' quitado de {category}", + "en": "'{quote}' removed from {category}", + "es": "'{quote}' quitado de {category}", "na'vi": "'{quote}'(it/ti) 'ìyaku {category}", - "welsh": "'{quote}' wedi ei ddileu o {category}" + "cy": "'{quote}' wedi ei ddileu o {category}" }, "q_not_exist_under": { - "english": "'{quote}' doesn't exist under '{category}'.", - "spanish": "'{quote}' no existe en '{category}'.", + "en": "'{quote}' doesn't exist under '{category}'.", + "es": "'{quote}' no existe en '{category}'.", "na'vi": "'{quote}' ke fkeytok '{category}'ta.", - "welsh": "Nid yw '{quote}' yn bodoli yn '{category}'" + "cy": "Nid yw '{quote}' yn bodoli yn '{category}'" }, "total_quotes": { - "english": "Total quote count: {count}.", - "spanish": "Total de citas: {count}.", + "en": "Total quote count: {count}.", + "es": "Total de citas: {count}.", "na'vi": "'upxareri holpxay: {count}.", - "welsh": "Cyfanswm dyfyniadau: {count}." + "cy": "Cyfanswm dyfyniadau: {count}." }, "quote_exists": { - "english": "Quote already in DB. Initiate incineration.", - "spanish": "Cita ya existe. Iniciar incineración.", + "en": "Quote already in DB. Initiate incineration.", + "es": "Cita ya existe. Iniciar incineración.", "na'vi": "'Upxarel säomumit fìtsengit tok srekrr. Nga skxawng lu.", - "welsh": "Dyfyniad yn y gronfa ddata yn barod. Cychwyn orfflosgiad" + "cy": "Dyfyniad yn y gronfa ddata yn barod. Cychwyn orfflosgiad" }, "quote_saved": { - "english": "Quote saved in '{category}' ({count}).", - "spanish": "Cita guardada en '{category}' ({count}).", + "en": "Quote saved in '{category}' ({count}).", + "es": "Cita guardada en '{category}' ({count}).", "na'vi": "Oe zayerok '{category}'mì ({count}).", - "welsh": "Dyfyniad wedi ei gadw yn '{category}' ({count})." + "cy": "Dyfyniad wedi ei gadw yn '{category}' ({count})." }, "quote_replace": { - "english": "No replacing arrays, you whore.", - "spanish": "No sustituites arrays, hijo de puta.", + "en": "No replacing arrays, you whore.", + "es": "No sustituites arrays, hijo de puta.", "na'vi": "Ngal fìsäomumit ke tsun rivawn. Nga muntxa sayi suteo hrh.", - "welsh": "Peidiwch a newid rhestrau, y cachgi" + "cy": "Peidiwch a newid rhestrau, y cachgi" }, "quote_count": { - "english": "{category} has {count} quotes.", - "spanish": "{category} tiene {count} citas.", + "en": "{category} has {count} quotes.", + "es": "{category} tiene {count} citas.", "na'vi": "{count}a upxare {category}ur lu.", - "welsh": "{count} dyfyniad yn {category}" + "cy": "{count} dyfyniad yn {category}" }, "quote_link": { - "english": "Link to {category} - {url}", - "spanish": "Enlace a {category} - {url}", + "en": "Link to {category} - {url}", + "es": "Enlace a {category} - {url}", "na'vi": "Fya'o {category}ne - {url}", - "welsh": "Dolen i {category} - {url}" + "cy": "Dolen i {category} - {url}" }, "search_results": { - "english": "{category} ({needle}): '{quote}' [{matches} results]", - "spanish" : "{category} ({needle}): '{quote}' [{matches} resultados]", + "en": "{category} ({needle}): '{quote}' [{matches} results]", + "es" : "{category} ({needle}): '{quote}' [{matches} resultados]", "na'vi": "{category} ({needle}): '{quote}' [kum a{matches}]", - "welsh": "{category} ({needle}): '{quote}' [{matches} canlyniad]" + "cy": "{category} ({needle}): '{quote}' [{matches} canlyniad]" }, "quote_cache_auto_remove": { - "english": "There are {count} quotes in the removal cache, which will be automatically cleared.", + "en": "There are {count} quotes in the removal cache, which will be automatically cleared.", "na'vi": "{count}a 'upxarel sngelit tok, Oel 'ayku sngelit lukenga." }, "quote_cache_manual_remove": { - "english": "There are {count} quotes in the removal cache, which must be manually cleared.", + "en": "There are {count} quotes in the removal cache, which must be manually cleared.", "na'vi": "{count}a 'upxarel sngelit tok slä oel ke 'ayku sngelit tafral nga zene 'aivku" }, "quote_cache_cleared": { - "english": "{count} quotes cleared from the removal cache.", + "en": "{count} quotes cleared from the removal cache.", "na'vi": "Oel 'aìmku {count}a 'upxareti ta sngel." }, "quote_cache_reinstated": { - "english": "{count} quotes reinstated from the removal cache.", + "en": "{count} quotes reinstated from the removal cache.", "na'vi": "{count}a 'upxare tolätxaw ta sngel." }, "rm_cache_limit": { - "english": "Attention: Too many quotes removed, rmCache must be cleared or reinstated manually with ~rmconfirm or ~rmdeny.", + "en": "Attention: Too many quotes removed, rmCache must be cleared or reinstated manually with ~rmconfirm or ~rmdeny.", "na'vi": "Oel zerok 'upxareti apxay set, sweylu txo nga 'aivku upxareti ìlä ~rmconfirm fu ~rmdeny." } } diff --git a/modules/rain/strings.json b/modules/rain/strings.json index 60904e6..235677e 100644 --- a/modules/rain/strings.json +++ b/modules/rain/strings.json @@ -1,44 +1,44 @@ - { - "rain-0": { - "english" : "It's not raining in {place}." - }, - "rain-1": { - "english" : "It's raining in {place}." - }, - "rain-2": { - "english" : "It's raining rather a lot in {place}." - }, - "rain-3": { - "english" : "It's raining shitloads." - }, - "rain-4": { - "english" : "It's raining fucktons." - }, - "rain-5": { - "english" : "It's raining whales (in {place})!" - }, - "rain-6": { - "english" : "IT'S SO FUCKING WET OUT HERE MAN" - }, - "rain-7": { - "english" : "I AM SO MOIST RIGHT NOW" - }, - "rain-8": { - "english" : "You used a #3 pencil instead of #2, didn't you?" - }, - "rain-9": { - "english" : "WELCOME TO ATLANTIS" - }, - "rain-10": { - "english" : "GET INSIDE" - }, - "rain-11": { - "english" : "LOL U PROBABLY DIED" - }, - "rain-e": { - "english" : "Unable to fetch weather data." - }, - "rain-u": { - "english": "Location too ambigious to process." - } -} + { + "rain-0": { + "en" : "It's not raining in {place}." + }, + "rain-1": { + "en" : "It's raining in {place}." + }, + "rain-2": { + "en" : "It's raining rather a lot in {place}." + }, + "rain-3": { + "en" : "It's raining shitloads." + }, + "rain-4": { + "en" : "It's raining fucktons." + }, + "rain-5": { + "en" : "It's raining whales (in {place})!" + }, + "rain-6": { + "en" : "IT'S SO FUCKING WET OUT HERE MAN" + }, + "rain-7": { + "en" : "I AM SO MOIST RIGHT NOW" + }, + "rain-8": { + "en" : "You used a #3 pencil instead of #2, didn't you?" + }, + "rain-9": { + "en" : "WELCOME TO ATLANTIS" + }, + "rain-10": { + "en" : "GET INSIDE" + }, + "rain-11": { + "en" : "LOL U PROBABLY DIED" + }, + "rain-e": { + "en" : "Unable to fetch weather data." + }, + "rain-u": { + "en": "Location too ambigious to process." + } +} diff --git a/modules/report/strings.json b/modules/report/strings.json index 3b0393d..242739a 100644 --- a/modules/report/strings.json +++ b/modules/report/strings.json @@ -1,18 +1,18 @@ { "report": { - "english": "Attention: {reporter} has reported {reported} in {channel}. The reason given was: \"{reason}.\"", + "en": "Attention: {reporter} has reported {reported} in {channel}. The reason given was: \"{reason}.\"", "na'vi": "{reporter}ìl fpìl futa {reported} fe' lu taluna {reason}." }, "reported": { - "english": "Thank you, {reported} has been reported to the channel administrators.", + "en": "Thank you, {reported} has been reported to the channel administrators.", "na'vi": "Irayo si ngari, fìtsengìri ayeyktan omum teri {reported}it set." }, "user_not_found": { - "english": "{reported} isn't a known user in {channel}.", + "en": "{reported} isn't a known user in {channel}.", "na'vi": "Oel ke omum {reported}it mì {channel}." }, "not_in_channel": { - "english": "I am not present in {channel}.", + "en": "I am not present in {channel}.", "na'vi": "Oel {channel}it ke tok." } } diff --git a/modules/spelling/strings.json b/modules/spelling/strings.json index 057786e..d7fc82e 100644 --- a/modules/spelling/strings.json +++ b/modules/spelling/strings.json @@ -1,14 +1,14 @@ { "spelling_self": { - "english": "{correcter} meant: {fix}", - "spanish": "{correcter} quería decir: {fix}", + "en": "{correcter} meant: {fix}", + "es": "{correcter} quería decir: {fix}", "na'vi": "Sweylu {correcter} pamrel sivi: {fix}", - "welsh": "Oedd {correcter} yn feddwl: {fix}" + "cy": "Oedd {correcter} yn feddwl: {fix}" }, "spelling_other": { - "english": "{correcter} thinks {candidate} meant: {fix}", - "spanish": "{correcter} piensa que {candidate} queria decir: {fix}", + "en": "{correcter} thinks {candidate} meant: {fix}", + "es": "{correcter} piensa que {candidate} queria decir: {fix}", "na'vi": "{correcter} fpìl futa sweylu {candiate} pamrel sivi: {fix}", - "welsh": "Mae {correcter} yn meddwl bod {candidate} yn feddwl: {fix}" + "cy": "Mae {correcter} yn meddwl bod {candidate} yn feddwl: {fix}" } } diff --git a/modules/users/strings.json b/modules/users/strings.json index b3d7a52..a46e7dc 100644 --- a/modules/users/strings.json +++ b/modules/users/strings.json @@ -1,26 +1,26 @@ { "alias": { - "english": "{alias} is an alias of {user}", + "en": "{alias} is an alias of {user}", "na'vi": "ayfko syaw {user} {alias} nìteng" }, "primary": { - "english": "{user} is a primary user with {count} aliases, ", + "en": "{user} is a primary user with {count} aliases, ", "na'vi": "{user} lu txin ulte {count}a stxo lu poru, " }, "unknown_alias": { - "english": "{alias} does not currently exist as an alias or known user.", + "en": "{alias} does not currently exist as an alias or known user.", "na'vi": "{alias} ke fkeytok nìfkrr" }, "aliasparentset": { - "english": "{newParent} is now the parent user, and {newAlias} is an alias.", + "en": "{newParent} is now the parent user, and {newAlias} is an alias.", "na'vi": "{newParent} lu sa'sem set ulte {newAlias} lu stxo set nìteng." }, "unprimary_error": { - "english": "One of those users isn't currently recorded as a primary user.", + "en": "One of those users isn't currently recorded as a primary user.", "na'vi": "fo sute txin ke lu." }, "merged_users": { - "english": "{old_user} and their aliases have been merged into {new_user}.", + "en": "{old_user} and their aliases have been merged into {new_user}.", "na'vi": "{old_user} ulte stxo alahe {new_user} lu set." } } From 9f007c906f33ddd7afe6c778b8f7bbd78e0f95fa Mon Sep 17 00:00:00 2001 From: Thomas Menari Date: Tue, 12 Feb 2013 19:14:27 +0000 Subject: [PATCH 02/18] spotify module --- modules/spotify/config.json | 4 +++ modules/spotify/spotify.js | 70 ++++++++++++++++++++++++++++++++++++ modules/spotify/strings.json | 11 ++++++ 3 files changed, 85 insertions(+) create mode 100644 modules/spotify/config.json create mode 100644 modules/spotify/spotify.js create mode 100644 modules/spotify/strings.json diff --git a/modules/spotify/config.json b/modules/spotify/config.json new file mode 100644 index 0000000..a051064 --- /dev/null +++ b/modules/spotify/config.json @@ -0,0 +1,4 @@ +{ + "dependencies": [ "command" ], + "ignorable": true +} diff --git a/modules/spotify/spotify.js b/modules/spotify/spotify.js new file mode 100644 index 0000000..a550241 --- /dev/null +++ b/modules/spotify/spotify.js @@ -0,0 +1,70 @@ +var request = require('request'), + _ = require('underscore')._; + +var spotify = function(dbot) { + /* examples: + * http://open.spotify.com/track/42SYMWISn7xUpTNPLw9V5E + * spotify:track:42SYMWISn7xUpTNPLw9V5E + * http://open.spotify.com/artist/3yY2gUcIsjMr8hjo51PoJ8 + * spotify:artist:3yY2gUcIsjMr8hjo51PoJ8 + * http://open.spotify.com/album/30g571JKoxs8AnsgAViV2J + * spotify:album:30g571JKoxs8AnsgAViV2J + */ + this.spotifyRegex = /(\b(https?:\/\/open.spotify.com\/(artist|track|album)\/\w*|spotify:(artist|track|album):\w*)\b)/ig; + this.spotifyLookup = 'http://ws.spotify.com/lookup/1/.json'; + this.spotifySearch = 'http://ws.spotify.com/search/1/track.json'; + + this.lookup = function(event, link) { + request({ + url: this.spotifyLookup, + qs: {uri: link}, + json: true + }, function(error, response, body) { + if (!error && response.statusCode == 200) { + var s = "\u00039spotify\u000f"; + if (body.hasOwnProperty('track')) { + event.reply(dbot.t("track", {s: s, artist: _.map(body.track.artists, function(a) { return a.name }).join(', '), album: body.track.album.name, track: body.track.name})); + } + else if (body.hasOwnProperty('album')) { + event.reply(dbot.t("album", {s: s, artist: body.album.artist, album: body.album.name})); + } + else if (body.hasOwnProperty('artist')) { + event.reply(dbot.t("artist", {s: s, artist: body.artist.name})); + } + } + }); + }; + + var commands = { + '~spotify': function(event) { + var query = event.input[1]; + request({ + url: this.spotifySearch, + qs: {q: query}, + json: true + }, function(error, response, body) { + if (!error && response.statusCode == 200) { + if (body.hasOwnProperty('tracks')) { + var t = body.tracks[0].href; + t = t.replace(/:/g, '/'); + t = t.replace(/spotify/, 'http://open.spotify.com'); + event.reply(t); + } + } + }); + } + }; + commands['~spotify'].regex = [/^~spotify (.*)/, 2]; + this.listener = function(event) { + var spotifyMatches = event.message.match(this.spotifyRegex); + if (spotifyMatches != null) { + this.lookup(event, spotifyMatches[0]); + } + }.bind(this); + this.on = 'PRIVMSG'; + this.commands = commands; +}; + +exports.fetch = function(dbot) { + return new spotify(dbot); +}; diff --git a/modules/spotify/strings.json b/modules/spotify/strings.json new file mode 100644 index 0000000..5deef8b --- /dev/null +++ b/modules/spotify/strings.json @@ -0,0 +1,11 @@ +{ + "artist": { + "english": "{s} [artist] {artist}" + }, + "album": { + "english": "{s} [album] {artist} - {album}" + }, + "track": { + "english": "{s} [track] {artist} - {track} (from {album})" + } +} From a00a5dafed99f26b7440c8e330e37a96c868fc46 Mon Sep 17 00:00:00 2001 From: Thomas Menari Date: Tue, 12 Feb 2013 19:31:34 +0000 Subject: [PATCH 03/18] fix spotify search crash --- modules/spotify/spotify.js | 18 ++++++++++-------- modules/spotify/strings.json | 3 +++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/spotify/spotify.js b/modules/spotify/spotify.js index a550241..b018cd9 100644 --- a/modules/spotify/spotify.js +++ b/modules/spotify/spotify.js @@ -21,15 +21,15 @@ var spotify = function(dbot) { json: true }, function(error, response, body) { if (!error && response.statusCode == 200) { - var s = "\u00039spotify\u000f"; - if (body.hasOwnProperty('track')) { - event.reply(dbot.t("track", {s: s, artist: _.map(body.track.artists, function(a) { return a.name }).join(', '), album: body.track.album.name, track: body.track.name})); + var spotify = "\u00039spotify\u000f"; + if (_.has(body, 'track')) { + event.reply(dbot.t("track", {s: spotify, artist: _.map(body.track.artists, function(a) { return a.name }).join(', '), album: body.track.album.name, track: body.track.name})); } - else if (body.hasOwnProperty('album')) { - event.reply(dbot.t("album", {s: s, artist: body.album.artist, album: body.album.name})); + else if (_.has(body, 'album')) { + event.reply(dbot.t("album", {s: spotify, artist: body.album.artist, album: body.album.name})); } - else if (body.hasOwnProperty('artist')) { - event.reply(dbot.t("artist", {s: s, artist: body.artist.name})); + else if (_.has(body, 'artist')) { + event.reply(dbot.t("artist", {s: spotify, artist: body.artist.name})); } } }); @@ -44,11 +44,13 @@ var spotify = function(dbot) { json: true }, function(error, response, body) { if (!error && response.statusCode == 200) { - if (body.hasOwnProperty('tracks')) { + if (_.has(body, 'tracks') && body.tracks[0] && _.has(body.tracks[0], 'href')) { var t = body.tracks[0].href; t = t.replace(/:/g, '/'); t = t.replace(/spotify/, 'http://open.spotify.com'); event.reply(t); + } else { + event.reply(dbot.t("not-found", {s: "\u00039spotify\u000f"})); } } }); diff --git a/modules/spotify/strings.json b/modules/spotify/strings.json index 5deef8b..e929996 100644 --- a/modules/spotify/strings.json +++ b/modules/spotify/strings.json @@ -7,5 +7,8 @@ }, "track": { "english": "{s} [track] {artist} - {track} (from {album})" + }, + "not-found": { + "english": "{s} No results." } } From ae12e319a6567f6ee2106117ca3739dc3b2bf65a Mon Sep 17 00:00:00 2001 From: Thomas Menari Date: Tue, 12 Feb 2013 19:38:52 +0000 Subject: [PATCH 04/18] show title for found song --- modules/spotify/spotify.js | 5 +++-- modules/spotify/strings.json | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/spotify/spotify.js b/modules/spotify/spotify.js index b018cd9..e10203d 100644 --- a/modules/spotify/spotify.js +++ b/modules/spotify/spotify.js @@ -44,13 +44,14 @@ var spotify = function(dbot) { json: true }, function(error, response, body) { if (!error && response.statusCode == 200) { + var spotify = "\u00039spotify\u000f"; if (_.has(body, 'tracks') && body.tracks[0] && _.has(body.tracks[0], 'href')) { var t = body.tracks[0].href; t = t.replace(/:/g, '/'); t = t.replace(/spotify/, 'http://open.spotify.com'); - event.reply(t); + event.reply(dbot.t("found", {s: spotify, artist: _.map(body.tracks[0].artists, function(a) { return a.name }).join(', '), album: body.tracks[0].album.name, track: body.tracks[0].name, url: t})); } else { - event.reply(dbot.t("not-found", {s: "\u00039spotify\u000f"})); + event.reply(dbot.t("not-found", {s: spotify})); } } }); diff --git a/modules/spotify/strings.json b/modules/spotify/strings.json index e929996..0b0b815 100644 --- a/modules/spotify/strings.json +++ b/modules/spotify/strings.json @@ -8,6 +8,9 @@ "track": { "english": "{s} [track] {artist} - {track} (from {album})" }, + "found": { + "english": "{s} [{url}] {artist} - {track} (from {album})" + }, "not-found": { "english": "{s} No results." } From 9715d78964c2f930db57c1fcd333eea2fbd6225c Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Tue, 12 Feb 2013 21:05:32 +0000 Subject: [PATCH 05/18] convert hyphens to a more appropriate en-dash --- modules/spotify/strings.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/spotify/strings.json b/modules/spotify/strings.json index 0b0b815..f134deb 100644 --- a/modules/spotify/strings.json +++ b/modules/spotify/strings.json @@ -3,15 +3,15 @@ "english": "{s} [artist] {artist}" }, "album": { - "english": "{s} [album] {artist} - {album}" + "english": "{s} [album] {artist} – {album}" }, "track": { - "english": "{s} [track] {artist} - {track} (from {album})" + "english": "{s} [track] {artist} – {track} (from {album})" }, "found": { - "english": "{s} [{url}] {artist} - {track} (from {album})" + "english": "{s} [{url}] {artist} – {track} (from {album})" }, - "not-found": { + "not–found": { "english": "{s} No results." } } From ea3338b2b94c917eeb2e1c6be41c7db1b38db2c2 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Tue, 12 Feb 2013 21:10:52 +0000 Subject: [PATCH 06/18] fix dash --- modules/spotify/strings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/spotify/strings.json b/modules/spotify/strings.json index f134deb..ce42112 100644 --- a/modules/spotify/strings.json +++ b/modules/spotify/strings.json @@ -11,7 +11,7 @@ "found": { "english": "{s} [{url}] {artist} – {track} (from {album})" }, - "not–found": { + "not-found": { "english": "{s} No results." } } From ef4de65e7f23682258fbba8516bebb638e81d22a Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Thu, 14 Feb 2013 02:58:11 +0000 Subject: [PATCH 07/18] Convert core strings.json to ISO 631 --- strings.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/strings.json b/strings.json index 630e213..1f67531 100644 --- a/strings.json +++ b/strings.json @@ -1,17 +1,17 @@ { "correction": { - "english": "Did you mean: ", - "spanish": "¿Querías decir: ", + "en": "Did you mean: ", + "es": "¿Querías decir: ", "na'vi": "Srake sweylu nga pamrel sivi: ", - "welsh": "A oeddech chi'n feddwl: " + "cy": "A oeddech chi'n feddwl: " }, "module_load_error": { - "english": "Failed to load module: {moduleName}", - "spanish": "No se pudó cargar el módulo: {moduleName}", + "en": "Failed to load module: {moduleName}", + "es": "No se pudó cargar el módulo: {moduleName}", "na'vi": "Oeru Oel {moduleName}it sung.", - "welsh": "Wedi methu a llwytho modiwl: {moduleName}" + "cy": "Wedi methu a llwytho modiwl: {moduleName}" }, "url": { - "english": "http://{host}:{port}/{path}" + "en": "http://{host}:{port}/{path}" } } From 66611c92a373d9241888ed6144352e5dff290d83 Mon Sep 17 00:00:00 2001 From: Sam Nicholls Date: Fri, 15 Feb 2013 17:28:54 +0000 Subject: [PATCH 08/18] ~link to use event input not params [Fix #273] --- modules/quotes/commands.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/quotes/commands.js b/modules/quotes/commands.js index c99fd01..24c7ba7 100644 --- a/modules/quotes/commands.js +++ b/modules/quotes/commands.js @@ -192,7 +192,7 @@ var commands = function(dbot) { }, '~link': function(event) { - var key = event.params[1].trim().toLowerCase(); + var key = event.input[1].toLowerCase(); if(_.has(quotes, key)) { event.reply(dbot.t('quote_link', { 'category': key, @@ -214,6 +214,7 @@ var commands = function(dbot) { commands['~rm'].regex = [/^~rm ([\d\w\s-]+?)[ ]?=[ ]?(.+)$/, 3]; commands['~rmlast'].regex = [/^~rmlast ([\d\w\s-]*)/, 2]; commands['~qadd'].regex = [/^~qadd ([\d\w\s-]+?)[ ]?=[ ]?(.+)$/, 3]; + commands['~link'].regex = [/^~link ([\d\w\s-]*)/, 2]; commands['~rmconfirm'].access = 'moderator'; commands['~rmdeny'].access = 'moderator'; From 238e204d8569df160612b8aede02b23aa2c72259 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 16 Feb 2013 18:06:58 +0000 Subject: [PATCH 09/18] Fix [#286] --- modules/quotes/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/quotes/commands.js b/modules/quotes/commands.js index ed76050..dbcbe73 100644 --- a/modules/quotes/commands.js +++ b/modules/quotes/commands.js @@ -77,7 +77,7 @@ var commands = function(dbot) { var needle = event.input[2]; if(_.has(quotes, haystack)) { var matches = _.filter(quotes[haystack], function(quote) { - return _.indexOf(quote, needle) != -1; + return quote.indexOf(needle) != -1; }, this); if(matches.length == 0) { From e648068b1cae7e065d2d3c0df2926bc123bfd5b7 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 16 Feb 2013 18:07:41 +0000 Subject: [PATCH 10/18] change default lang to en so no crash --- run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.js b/run.js index 48ad4d5..fadc12b 100644 --- a/run.js +++ b/run.js @@ -90,7 +90,7 @@ DBot.prototype.t = function(string, formatData) { if(_.has(this.strings, string)) { var lang = this.config.language; if(!_.has(this.strings[string], lang)) { - lang = "english"; + lang = "en"; } formattedString = this.strings[string][lang].format(formatData); From 57977ac182a017cb37bd02371a1225d6cd008fc7 Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 20 Feb 2013 10:28:47 +0000 Subject: [PATCH 11/18] dont bother with titles if they are too long --- modules/link/link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/link/link.js b/modules/link/link.js index b72e8e8..be97299 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -14,7 +14,7 @@ var link = function(dbot) { if(!error && response.statusCode == 200) { body = body.replace(/(\r\n|\n\r|\n)/gm, " "); var title = body.valMatch(/(.*)<\/title>/, 2); - if(title) { + if(title && title.length < 140) { event.reply(title[1]); } } From f6d89defe7c15cf3c95fea90c37150f601ae003f Mon Sep 17 00:00:00 2001 From: xray7224 <xray7224@googlemail.com> Date: Mon, 25 Feb 2013 00:32:06 +0000 Subject: [PATCH 12/18] =?UTF-8?q?ngari=20oel=20ngolop=20ayl=C3=AC'uti=20n?= =?UTF-8?q?=C3=ACmun=20=3D]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/link/strings.json | 3 ++- modules/rain/strings.json | 42 ++++++++++++++++++++++++------------ modules/spotify/strings.json | 3 ++- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/modules/link/strings.json b/modules/link/strings.json index a89c9e5..832b243 100644 --- a/modules/link/strings.json +++ b/modules/link/strings.json @@ -7,6 +7,7 @@ "en": "xkcd {num}: {title} https://xkcd.com/{num}" }, "no-hits": { - "en": "No hits." + "en": "No hits.", + "na'vi": "Oel ke tsun rivum ayuoti." } } diff --git a/modules/rain/strings.json b/modules/rain/strings.json index 235677e..76c765a 100644 --- a/modules/rain/strings.json +++ b/modules/rain/strings.json @@ -1,44 +1,58 @@ { "rain-0": { - "en" : "It's not raining in {place}." + "en" : "It's not raining in {place}.", + "na'vi": "tompa ke zup {place}ur." }, "rain-1": { - "en" : "It's raining in {place}." + "en" : "It's raining in {place}.", + "na'vi":"tompa zup {place}ur." }, "rain-2": { - "en" : "It's raining rather a lot in {place}." + "en" : "It's raining rather a lot in {place}.", + "na'vi":"tompa zup {place}ur nìhawng." }, "rain-3": { - "en" : "It's raining shitloads." + "en" : "It's raining shitloads.", + "na'vi":"tompa zup {place}ur nìhawng." }, "rain-4": { - "en" : "It's raining fucktons." + "en" : "It's raining fucktons.", + "na'vi": "tompa zup {place}ur nìhawng." }, "rain-5": { - "en" : "It's raining whales (in {place})!" + "en" : "It's raining whales (in {place})!", + "na'vi": "payoang zup {place}ur" }, "rain-6": { - "en" : "IT'S SO FUCKING WET OUT HERE MAN" + "en" : "IT'S SO FUCKING WET OUT HERE MAN", + "na'vi" : "pey lu oeru nìhawng taluna tok fìtengeti" }, "rain-7": { - "en" : "I AM SO MOIST RIGHT NOW" + "en" : "I AM SO MOIST RIGHT NOW", + "na'vi":"pey lu oeru nìhawng taluna tok fìtengeti" }, "rain-8": { - "en" : "You used a #3 pencil instead of #2, didn't you?" + "en" : "You used a #3 pencil instead of #2, didn't you?", + "na'vi": "Nga pamrel sami hu pencìl a#3 ulte ke pamrel sami pencìl a#2 kefyak?" }, "rain-9": { - "en" : "WELCOME TO ATLANTIS" + "en" : "WELCOME TO ATLANTIS", + "na'vi": "ziva'u nìprrte atlantisftu." }, "rain-10": { - "en" : "GET INSIDE" + "en" : "GET INSIDE", + "na'vi": "Sweylu txo nga livatam futa ngal fìtsengeti tok" }, "rain-11": { - "en" : "LOL U PROBABLY DIED" + "en" : "LOL U PROBABLY DIED", + "na'vi": "hrh kxawm nga tolerkup." }, "rain-e": { - "en" : "Unable to fetch weather data." + "en" : "Unable to fetch weather data.", + "na'vi":"Oel ke tsun rivum sänumeti teriyafkeyk." }, "rain-u": { - "en": "Location too ambigious to process." + "en": "Location too ambigious to process.", + "na'vi":"tsengeri, yayayr lu oeru." } } diff --git a/modules/spotify/strings.json b/modules/spotify/strings.json index ce42112..9899843 100644 --- a/modules/spotify/strings.json +++ b/modules/spotify/strings.json @@ -12,6 +12,7 @@ "english": "{s} [{url}] {artist} – {track} (from {album})" }, "not-found": { - "english": "{s} No results." + "english": "{s} No results.", + "na'vi": "{s}, Oel ke tsun rivum ayuoti." } } From ab8e297769ab0f4770406d8ab775ab2c461ade2b Mon Sep 17 00:00:00 2001 From: Douglas Gardner <douglas@chippy.ch> Date: Wed, 6 Mar 2013 13:02:02 +0000 Subject: [PATCH 13/18] add basic, hackish finger functionality --- modules/finger/README.md | 13 +++++++++++++ modules/finger/finger.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 modules/finger/README.md create mode 100644 modules/finger/finger.js diff --git a/modules/finger/README.md b/modules/finger/README.md new file mode 100644 index 0000000..549e850 --- /dev/null +++ b/modules/finger/README.md @@ -0,0 +1,13 @@ +## Finger + +Retrieves user information from a remote server. + +### Description +Uses the ``finger`` command to retrieve limited information on users. + + +### Commands +###~finger [username] +Returns the real name of the user specified. +### Dependencies +* ``npm install request`` diff --git a/modules/finger/finger.js b/modules/finger/finger.js new file mode 100644 index 0000000..84256e6 --- /dev/null +++ b/modules/finger/finger.js @@ -0,0 +1,29 @@ +/** + * Module Name: Finger + * Description: Returns the name of users via the Finger protocol + */ +var request = require('request'), + _ = require('underscore')._, + exec = require('child_process').exec; + +var finger = function(dbot) { + var commands = { + '~finger': function(event) { + var username = event.params[1]; + exec("finger -s " + username + "@central.aber.ac.uk",function(error,stdout,stderr){ + name = stdout.search("Name:"); + stdout = stdout.substring(name); + ret = stdout.search("Dir"); + stdout = stdout.substring(0,ret); + event.reply(stdout); + }); + } + }; + this.commands = commands; + + this.on = 'PRIVMSG'; +}; + +exports.fetch = function(dbot) { + return new finger(dbot); +}; From 3cdf3fd4176dddd42aaa2c3717111f845d3fc5f6 Mon Sep 17 00:00:00 2001 From: Douglas Gardner <douglas@chippy.ch> Date: Wed, 6 Mar 2013 13:10:54 +0000 Subject: [PATCH 14/18] add string functionality --- modules/finger/finger.js | 5 +++-- modules/finger/strings.json | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 modules/finger/strings.json diff --git a/modules/finger/finger.js b/modules/finger/finger.js index 84256e6..1334af6 100644 --- a/modules/finger/finger.js +++ b/modules/finger/finger.js @@ -11,11 +11,12 @@ var finger = function(dbot) { '~finger': function(event) { var username = event.params[1]; exec("finger -s " + username + "@central.aber.ac.uk",function(error,stdout,stderr){ + stdout = stdout.replace(/(\r\n|\n|\r)/gm,""); name = stdout.search("Name:"); stdout = stdout.substring(name); ret = stdout.search("Dir"); - stdout = stdout.substring(0,ret); - event.reply(stdout); + stdout = stdout.substring(6,ret); + event.reply(dbot.t("name",{user: username, name: stdout})); }); } }; diff --git a/modules/finger/strings.json b/modules/finger/strings.json new file mode 100644 index 0000000..5b79835 --- /dev/null +++ b/modules/finger/strings.json @@ -0,0 +1,5 @@ +{ + "name": { + "en": "{user} is {name}." + } +} From 9d277c7ac632b961ed2a0a1da4aa9c0050f6a8ef Mon Sep 17 00:00:00 2001 From: Douglas Gardner <douglas@chippy.ch> Date: Wed, 6 Mar 2013 13:20:58 +0000 Subject: [PATCH 15/18] add hackish handling of non-existent users --- modules/finger/finger.js | 6 +++++- modules/finger/strings.json | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/finger/finger.js b/modules/finger/finger.js index 1334af6..f0a2e34 100644 --- a/modules/finger/finger.js +++ b/modules/finger/finger.js @@ -16,7 +16,11 @@ var finger = function(dbot) { stdout = stdout.substring(name); ret = stdout.search("Dir"); stdout = stdout.substring(6,ret); - event.reply(dbot.t("name",{user: username, name: stdout})); + if (stdout == "Welcom") { + event.reply(dbot.t("nonexistent",{user: username})); + } else { + event.reply(dbot.t("name",{user: username, name: stdout})); + } }); } }; diff --git a/modules/finger/strings.json b/modules/finger/strings.json index 5b79835..710e0f5 100644 --- a/modules/finger/strings.json +++ b/modules/finger/strings.json @@ -1,5 +1,8 @@ { "name": { "en": "{user} is {name}." + }, + "nonexistent": { + "en": "{user} not found." } } From 5a6f6ad39e2d9c9305cc9ba2f518507cc663f487 Mon Sep 17 00:00:00 2001 From: Thomas Menari <t@menari.eu> Date: Sat, 9 Mar 2013 17:02:33 +0000 Subject: [PATCH 16/18] entity decoding for link module --- modules/link/README.md | 3 +++ modules/link/link.js | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/link/README.md b/modules/link/README.md index fed0a33..d8b85cd 100644 --- a/modules/link/README.md +++ b/modules/link/README.md @@ -23,3 +23,6 @@ which was posted in the current channel. Returns the first [Urban Dictionary](http://www.urbandictionary.com) definition for the headword provided. #### ~xkcd <comic ID> Returns a link to the [xkcd](http://xkcd.com) comic specified, or the latest one if a comic is not given. Use '*' to return a link to a random comic. + +### Requirements +* [node-ent](https://github.com/substack/node-ent) diff --git a/modules/link/link.js b/modules/link/link.js index be97299..2d9c994 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -4,7 +4,8 @@ * information about links. */ var request = require('request'), - _ = require('underscore')._; + _ = require('underscore')._, + ent = require('ent'); var link = function(dbot) { this.urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; @@ -15,7 +16,7 @@ var link = function(dbot) { body = body.replace(/(\r\n|\n\r|\n)/gm, " "); var title = body.valMatch(/<title>(.*)<\/title>/, 2); if(title && title.length < 140) { - event.reply(title[1]); + event.reply(ent.decode(title[1])); } } }); From 4b5bf08fe9d3cf1d2c097f23f869154a5988bf71 Mon Sep 17 00:00:00 2001 From: Thomas Menari <t@menari.eu> Date: Mon, 11 Mar 2013 19:30:00 +0000 Subject: [PATCH 17/18] Add identica+twitter status fetching --- modules/dent/dent.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/modules/dent/dent.js b/modules/dent/dent.js index 5638ccc..311d9d0 100644 --- a/modules/dent/dent.js +++ b/modules/dent/dent.js @@ -3,6 +3,15 @@ var request = require('request'); var dent = function(dbot) { this.dbot = dbot; + this.StatusRegex = { + identica: /\bhttps?:\/\/identi\.ca\/notice\/(\d+)\b/ig, + twitter: /\bhttps?:\/\/twitter\.com\/\w+\/status\/(\d+)\b/ig + }; + + this.StatusAPI = { + identica: "http://identi.ca/api/statuses/show.json", + twitter: "https://api.twitter.com/1/statuses/show.json" + }; this.api = { 'post': function(content) { @@ -25,6 +34,20 @@ var dent = function(dbot) { } }; + this.lookup = function(event, id, service) { + request({ + url: this.StatusAPI[service], + qs: {"id": id}, + json: true + }, function(error, response, body) { + if (!error && response.statusCode == 200) { + if (_.has(body, 'text')) { + event.reply(service + " [" + body.user.screen_name + '] ' + body.text); + } + } + }); + }; + this.commands = { '~dent': function(event) { this.api.post(event.input[1]); @@ -40,6 +63,19 @@ var dent = function(dbot) { }.bind(this)); } }.bind(this); + + this.listener = function(event) { + for (s in this.StatusRegex) { + if (this.StatusRegex.hasOwnProperty(s)) { + var matches = this.StatusRegex[s].exec(event.message); + if (matches != null) { + this.lookup(event, matches[1], s); + } + } + } + }.bind(this); + + this.on = 'PRIVMSG'; }; exports.fetch = function(dbot) { From 4bb9f903984458cce277a283392c01b51cbc4cfc Mon Sep 17 00:00:00 2001 From: reality <tinmachin3@gmail.com> Date: Tue, 12 Mar 2013 19:59:44 +0000 Subject: [PATCH 18/18] bump stats --- modules/stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/stats b/modules/stats index e296082..eee5861 160000 --- a/modules/stats +++ b/modules/stats @@ -1 +1 @@ -Subproject commit e2960823d8c82c0ff5f0a360c9acfacc024fb85a +Subproject commit eee5861dca00f0d2b2f146820870abb888ed8f4a