diff --git a/VERSION b/VERSION index 4a117f30..d3857295 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-27 12:55:36) dev +Version 2.00.0 (2012-08-27 13:10:48) dev diff --git a/applications/welcome/languages/default.py b/applications/welcome/languages/default.py index 17cc65dc..95dbd6c8 100644 --- a/applications/welcome/languages/default.py +++ b/applications/welcome/languages/default.py @@ -2,4 +2,12 @@ { '!langcode!': 'en-us', '!langname!': 'English (US)', +'%s %%(shop)': '%s %%(shop)', +'%s %%(shop[0])': '%s %%(shop[0])', +'%s %%{shop[0]}': '%s %%{shop[0]}', +'%s %%{shop}': '%s %%{shop}', +'@markmin\x01**Hello World**': '**Hello World**', +'Hello World': 'Hello World', +'Hello World ## comment': 'Hello World ', +'Hello World## comment': 'Hello World', } diff --git a/applications/welcome/languages/it.py b/applications/welcome/languages/it.py index afa3109a..0d315706 100644 --- a/applications/welcome/languages/it.py +++ b/applications/welcome/languages/it.py @@ -9,16 +9,26 @@ '%s selected': '%s selezionato', '%Y-%m-%d': '%d/%m/%Y', '%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S', +'About': 'About', +'Access Control': 'Access Control', +'Administrative Interface': 'Administrative Interface', 'Administrative interface': 'Interfaccia amministrativa', +'Ajax Recipes': 'Ajax Recipes', 'appadmin is disabled because insecure channel': 'Amministrazione (appadmin) disabilitata: comunicazione non sicura', +'Are you sure you want to delete this object?': 'Are you sure you want to delete this object?', 'Available databases and tables': 'Database e tabelle disponibili', +'Buy this book': 'Buy this book', 'cache': 'cache', 'Cannot be empty': 'Non può essere vuoto', 'change password': 'Cambia password', 'Check to delete': 'Seleziona per cancellare', 'Client IP': 'Client IP', +'Community': 'Community', +'Components and Plugins': 'Components and Plugins', 'Controller': 'Controller', 'Copyright': 'Copyright', +'Created By': 'Created By', +'Created On': 'Created On', 'Current request': 'Richiesta (request) corrente', 'Current response': 'Risposta (response) corrente', 'Current session': 'Sessione (session) corrente', @@ -31,77 +41,121 @@ 'DB Model': 'Modello di DB', 'Delete': 'Delete', 'Delete:': 'Cancella:', +'Demo': 'Demo', +'Deployment Recipes': 'Deployment Recipes', 'Description': 'Descrizione', 'design': 'progetta', 'Documentation': 'Documentazione', +"Don't know what to do?": "Don't know what to do?", 'done!': 'fatto!', +'Download': 'Download', 'E-mail': 'E-mail', 'Edit': 'Modifica', 'Edit current record': 'Modifica record corrente', 'edit profile': 'modifica profilo', 'Edit This App': 'Modifica questa applicazione', +'Email and SMS': 'Email and SMS', +'enter an integer between %(min)g and %(max)g': 'enter an integer between %(min)g and %(max)g', +'Errors': 'Errors', 'export as csv file': 'esporta come file CSV', +'FAQ': 'FAQ', 'First name': 'Nome', +'Forms and Validators': 'Forms and Validators', +'Free Applications': 'Free Applications', 'Group ID': 'ID Gruppo', +'Groups': 'Groups', 'hello': 'hello', 'hello world': 'salve mondo', 'Hello World': 'Salve Mondo', 'Hello World in a flash!': 'Salve Mondo in un flash!', +'Home': 'Home', +'How did you get here?': 'How did you get here?', 'Import/Export': 'Importa/Esporta', 'Index': 'Indice', 'insert new': 'inserisci nuovo', 'insert new %s': 'inserisci nuovo %s', 'Internal State': 'Stato interno', +'Introduction': 'Introduction', 'Invalid email': 'Email non valida', 'Invalid Query': 'Richiesta (query) non valida', 'invalid request': 'richiesta non valida', +'Is Active': 'Is Active', 'Last name': 'Cognome', 'Layout': 'Layout', +'Layout Plugins': 'Layout Plugins', +'Layouts': 'Layouts', +'Live Chat': 'Live Chat', 'login': 'accesso', +'Login': 'Login', 'logout': 'uscita', +'Lost password?': 'Lost password?', 'lost password?': 'dimenticato la password?', 'Main Menu': 'Menu principale', 'Menu Model': 'Menu Modelli', +'Modified By': 'Modified By', +'Modified On': 'Modified On', +'My Sites': 'My Sites', 'Name': 'Nome', 'New Record': 'Nuovo elemento (record)', 'new record inserted': 'nuovo record inserito', 'next 100 rows': 'prossime 100 righe', 'No databases in this application': 'Nessun database presente in questa applicazione', 'not authorized': 'non autorizzato', +'Object or table name': 'Object or table name', 'Online examples': 'Vedere gli esempi', 'or import from csv file': 'oppure importa da file CSV', 'Origin': 'Origine', +'Other Plugins': 'Other Plugins', +'Other Recipes': 'Other Recipes', +'Overview': 'Overview', 'Password': 'Password', +'Plugins': 'Plugins', 'Powered by': 'Powered by', +'Preface': 'Preface', 'previous 100 rows': '100 righe precedenti', +'Python': 'Python', 'Query:': 'Richiesta (query):', +'Quick Examples': 'Quick Examples', +'Recipes': 'Recipes', 'record': 'record', 'record does not exist': 'il record non esiste', 'record id': 'record id', 'Record ID': 'Record ID', +'Register': 'Register', 'register': 'registrazione', +'Registration identifier': 'Registration identifier', 'Registration key': 'Chiave di Registazione', 'Reset Password key': 'Resetta chiave Password ', 'Role': 'Ruolo', 'Rows in table': 'Righe nella tabella', 'Rows selected': 'Righe selezionate', +'Semantic': 'Semantic', +'Services': 'Services', 'state': 'stato', 'Stylesheet': 'Foglio di stile (stylesheet)', +'Support': 'Support', 'Sure you want to delete this object?': 'Vuoi veramente cancellare questo oggetto?', 'table': 'tabella', 'Table name': 'Nome tabella', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La richiesta (query) è una condizione come ad esempio "db.tabella1.campo1==\'valore\'". Una condizione come "db.tabella1.campo1==db.tabella2.campo2" produce un "JOIN" SQL.', +'The Core': 'The Core', 'The output of the file is a dictionary that was rendered by the view %s': 'L\'output del file è un "dictionary" che è stato visualizzato dalla vista %s', +'The Views': 'The Views', +'This App': 'This App', 'This is a copy of the scaffolding application': "Questa è una copia dell'applicazione di base (scaffold)", 'Timestamp': 'Ora (timestamp)', +'Twitter': 'Twitter', 'unable to parse csv file': 'non riesco a decodificare questo file CSV', 'Update': 'Update', 'Update:': 'Aggiorna:', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Per costruire richieste (query) più complesse si usano (...)&(...) come "e" (AND), (...)|(...) come "o" (OR), e ~(...) come negazione (NOT).', 'User ID': 'ID Utente', +'Videos': 'Videos', 'View': 'Vista', +'Welcome': 'Welcome', 'Welcome %s': 'Benvenuto %s', 'Welcome to web2py': 'Benvenuto su web2py', +'Welcome to web2py!': 'Welcome to web2py!', 'Which called the function %s located in the file %s': 'che ha chiamato la funzione %s presente nel file %s', 'You are successfully running web2py': 'Stai eseguendo web2py con successo', 'You can modify this application and adapt it to your needs': 'Puoi modificare questa applicazione adattandola alle tue necessità', diff --git a/gluon/tests/test_languages.py b/gluon/tests/test_languages.py index 7bf30d71..bcff8de4 100644 --- a/gluon/tests/test_languages.py +++ b/gluon/tests/test_languages.py @@ -17,6 +17,7 @@ import languages import tempfile import threading import logging +from storage import Storage try: import multiprocessing @@ -53,6 +54,39 @@ try: for result in results: self.assertTrue(result) + + class TestTranslations(unittest.TestCase): + + def setUp(self): + self.request = Storage() + self.request.folder = 'applications/welcome' + self.request.env = Storage() + self.request.env.http_accept_language = 'en' + + + def tearDown(self): + pass + + def test_plain(self): + T = languages.translator(self.request) + self.assertEqual(str(T('Hello World')), + 'Hello World') + self.assertEqual(str(T('Hello World## comment')), + 'Hello World') + self.assertEqual(str(T('%s %%{shop}', 1)), + '1 shop') + self.assertEqual(str(T('%s %%{shop}', 2)), + '2 shops') + self.assertEqual(str(T('%s %%{shop[0]}', 1)), + '1 shop') + self.assertEqual(str(T('%s %%{shop[0]}', 2)), + '2 shops') + self.assertEqual(str(T.M('**Hello World**')), + 'Hello World') + T.force('it') + self.assertEqual(str(T('Hello World')), + 'Salve Mondo') + except ImportError: logging.warning("Skipped test case, no multiprocessing module.")