#!/usr/bin/env python
-#
+# -*- coding: utf-8 -*-
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
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.
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 = {}