From: Ben Darnell Date: Sat, 16 Mar 2013 05:25:22 +0000 (-0400) Subject: Fix docstring for locale.load_translations. X-Git-Tag: v3.0.0~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d6985514e3bdbc294a6fc42ce551b60995c9a40;p=thirdparty%2Ftornado.git Fix docstring for locale.load_translations. When unicode strings started using the u() function, this string was no longer considered a docstring. --- diff --git a/tornado/locale.py b/tornado/locale.py index e4e1a1544..522e51e08 100644 --- a/tornado/locale.py +++ b/tornado/locale.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# +# -*- coding: utf-8 -*- # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -85,7 +85,7 @@ def set_default_locale(code): def load_translations(directory): - u("""Loads translations from CSV files in a directory. + """Loads translations from CSV files in a directory. Translations are strings with optional Python-style named placeholders (e.g., "My name is %(name)s") and their associated translations. @@ -104,13 +104,13 @@ def load_translations(directory): The file is read using the csv module in the default "excel" dialect. In this format there should not be spaces after the commas. - Example translation es_LA.csv: + Example translation es_LA.csv:: "I love you","Te amo" - "%(name)s liked this","A %(name)s les gust\u00f3 esto","plural" - "%(name)s liked this","A %(name)s le gust\u00f3 esto","singular" + "%(name)s liked this","A %(name)s les gustó esto","plural" + "%(name)s liked this","A %(name)s le gustó esto","singular" - """) + """ global _translations global _supported_locales _translations = {}