forked from openlp/openlp
- Changed "&" back to "and"
This commit is contained in:
parent
946fb02d57
commit
036907eb5e
@ -307,13 +307,12 @@ def expand_tags(text):
|
|||||||
text = text.replace(tag['end tag'], tag['end html'])
|
text = text.replace(tag['end tag'], tag['end html'])
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
def create_separated_list(string_list):
|
def create_separated_list(string_list):
|
||||||
"""
|
"""
|
||||||
Returns a string that represents a join of a list of strings with a localized separator. This function corresponds
|
Returns a string that represents a join of a list of strings with a localized separator.
|
||||||
to QLocale::createSeparatedList which was introduced in Qt 4.8 and implements the algorithm from
|
Localized separation will be done via the translate() function by the translators.
|
||||||
http://www.unicode.org/reports/tr35/#ListPatterns
|
|
||||||
NOTE: translate() can change the format based on language styling (ex: Finnish not using "{} and {}" rather than
|
|
||||||
english style "{} , and {}").
|
|
||||||
:param string_list: List of unicode strings
|
:param string_list: List of unicode strings
|
||||||
:return: Formatted string
|
:return: Formatted string
|
||||||
"""
|
"""
|
||||||
@ -321,9 +320,9 @@ def create_separated_list(string_list):
|
|||||||
if list_length == 1:
|
if list_length == 1:
|
||||||
return_list = string_list[0]
|
return_list = string_list[0]
|
||||||
elif list_length == 2:
|
elif list_length == 2:
|
||||||
return_list = translate('OpenLP.core.lib', '{one} & {two}').format(one=string_list[0], two=string_list[1])
|
return_list = translate('OpenLP.core.lib', '{one} and {two}').format(one=string_list[0], two=string_list[1])
|
||||||
elif list_length > 2:
|
elif list_length > 2:
|
||||||
return_list = translate('OpenLP.core.lib', '{first}, & {last}').format(first=', '.join(string_list[:-1]),
|
return_list = translate('OpenLP.core.lib', '{first}, and {last}').format(first=', '.join(string_list[:-1]),
|
||||||
last=string_list[-1])
|
last=string_list[-1])
|
||||||
else:
|
else:
|
||||||
return_list = ""
|
return_list = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user