Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for .h files, and support for UIBarButtonItem customView #13

Merged
merged 3 commits into from Mar 27, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Framework/Scripts/actions/create
Expand Up @@ -95,7 +95,7 @@ def create_strings(config):
if os.path.exists(source):
sources.append(source)
for file in os.listdir(source):
if file.endswith('.m'):
if file.endswith('.m') or file.endswith('.h'):
mod = os.path.getmtime(os.path.join(source, file))
if not latest or mod > latest: latest = mod

Expand All @@ -107,7 +107,7 @@ def create_strings(config):
sys.stdout.write('Generating %s strings for source files\n' % (config.lang,))
if not os.path.exists(resources): os.mkdir(resources)
localizable.ensure_dir()
find_args = [ 'find' ] + sources + [ '-name', '*.m', '-print0', ]
find_args = [ 'find' ] + sources + [ '-name', '*.m', '-or', '-name', '*.h', '-print0', ]
find_results = subprocess.check_output(find_args).split("\0")
genstrings_args = [ 'genstrings', '-s', LOCALIZE_SYMBOL, '-o', os.path.dirname(localizable.path()) ] + find_results
subprocess.check_output(genstrings_args)
Expand Down
4 changes: 4 additions & 0 deletions Framework/Source/iOS/FRUIAutomaticLocalization.m
Expand Up @@ -261,6 +261,10 @@ - (void)localizeObject:(id)object {
// localize subviews
[self localizeObject:[localizeSubviews allObjects]];
}
else if ([object isKindOfClass:[UIBarButtonItem class]]) {
[self localizeTitle:object];
[self localizeObject:[object customView]];
}
else if ([object isKindOfClass:[UIBarItem class]]) {
[self localizeTitle:object];
}
Expand Down