Skip to content

Instantly share code, notes, and snippets.

View txomon's full-sized avatar

Javier Domingo Cansino txomon

  • Germany/Koln, UK/London, Spain/Bilbao
View GitHub Profile
@txomon
txomon / createInfoPlistStrings.sh
Last active June 9, 2016 19:13 — forked from tritter/createInfoPlistStrings.sh
script is intended to use inside an Xcode project's build steps. It creates a InfoPlist.strings file that are used by the system to localize Info.plist values.
#!/bin/bash
# Thom Ritterfeld 2016
# This script is intended to use inside an Xcode project's build steps. It creates a InfoPlist.strings file that are used by the system to localize Info.plist values.
# Define localize keys values, the values are the ones that need to be placed inside InfoPlist.strings.
# For example in Localizable.strings you defined: "location_in_use_desc" = "we want to know where you work";
# This script will add "NSLocationWhenInUseUsageDescription" = "we want to know where you work"; into InfoPlist.strings.
# To define these keys define the key of Localizable.strings into localizable_keys and the key for InfoPlist.strings into info_plist_keys.
# Use the same positions, because of lack of good dictionary support. For the sample:
# declare -a localizable_keys=("location_in_use_desc")
def _operations_list_to_string(self,operations):
""" (list | str) -> str
The function returns a plain string of the inner lists
>>> _operations_list_to_string(['a','+',[['b','+','d'],'*','c']])
'(a+((b+d)*c))'
"""
if type(operations) == list:
result = '('
for operation in operations: