project_files/HedgewarsMobile/Classes/LabelWithIBLocalization.m
author Wuzzy <Wuzzy2@mail.ru>
Sat, 15 Dec 2018 01:29:47 +0100
changeset 14453 09bfe9df51e9
parent 11227 0dd98551e3f8
permissions -rw-r--r--
Make various stunts in flying saucer training easier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11227
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     1
/*
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     3
 * Copyright (c) 2015 Anton Malmygin <antonc27@mail.ru>
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     4
 *
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     8
 *
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    12
 * GNU General Public License for more details.
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    13
 *
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    17
 */
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    18
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    19
#import "LabelWithIBLocalization.h"
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    20
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    21
@interface LabelWithIBLocalization ()
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    22
@property (nonatomic) BOOL isAlreadyLocalized;
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    23
@end
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    24
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    25
@implementation LabelWithIBLocalization
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    26
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    27
- (void)layoutSubviews
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    28
{
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    29
    [super layoutSubviews];
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    30
    
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    31
    if (!self.isAlreadyLocalized)
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    32
    {
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    33
        // Text which set in Interface Builder used here as a key for localization
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    34
        self.text = NSLocalizedString(self.text, nil);
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    35
        
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    36
        [self setNeedsLayout];
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    37
        self.isAlreadyLocalized = YES;
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    38
    }
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    39
}
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    40
0dd98551e3f8 - All labels in HelpPageLobby now localizable (with text from IB as localization keys)
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    41
@end