-
Notifications
You must be signed in to change notification settings - Fork 21
/
412 localizing with xcode 6 [English].srt
3439 lines (2700 loc) · 62.2 KB
/
412 localizing with xcode 6 [English].srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1
00:00:12,087 --> 00:00:15,133
well what time to a mall
2
00:00:16,033 --> 00:00:20,070
welcome everybody to localization with
Xcode 6
3
00:00:20,007 --> 00:00:25,007
my name is sold in forty Fisher and I'm
an engineer
4
00:00:25,007 --> 00:00:30,082
with the Xcode team later my colleague
Chris Hansen will join me on stage
5
00:00:31,045 --> 00:00:34,080
so you spend time on your
6
00:00:34,008 --> 00:00:38,727
applications artwork you spend time on
your application's code
7
00:00:39,519 --> 00:00:44,210
but you may yet have to configure your
Global Audience
8
00:00:44,021 --> 00:00:48,029
the App Store is available in 150
countries around the world
9
00:00:49,001 --> 00:00:53,620
here's a small fraction of them and
there are literally hundreds of millions
10
00:00:53,629 --> 00:00:58,120
users shopping in the stores the
interesting thing is
11
00:00:58,012 --> 00:01:01,094
there's no one dominant language around
the world
12
00:01:01,094 --> 00:01:05,103
I O S is localizing to 40 languages
13
00:01:06,003 --> 00:01:10,081
to reach a global audience to take your
applications to the next level
14
00:01:10,081 --> 00:01:15,128
you simply must localize so if this
sounds like an interesting opportunity
15
00:01:16,028 --> 00:01:21,054
you've come to the right place will
bring you guys up to speed
16
00:01:21,054 --> 00:01:25,083
on Apple's award-winning
17
00:01:25,083 --> 00:01:28,170
supports for I O S and Mac OS 10
18
00:01:29,007 --> 00:01:33,025
and of course will details from the work
clothes in Xcode
19
00:01:33,088 --> 00:01:37,105
to help you get your application
localized and for the old hands out
20
00:01:38,005 --> 00:01:38,046
there
21
00:01:38,046 --> 00:01:41,054
we have some new features that I think
you'll find very interesting
22
00:01:41,054 --> 00:01:44,142
I want to take a step back for a moment
though and introduce a useful
23
00:01:45,042 --> 00:01:45,123
distinction
24
00:01:46,023 --> 00:01:50,057
internationalization isn't quite the
same
25
00:01:50,057 --> 00:01:54,121
as localization I like to think I've
26
00:01:55,021 --> 00:01:58,057
internationalization as a milestone
27
00:01:58,057 --> 00:02:04,069
on the path to a localized application
internationalization
28
00:02:04,069 --> 00:02:07,418
is where you structure your application
to be
29
00:02:08,039 --> 00:02:11,420
language in region independent that
involves
30
00:02:11,042 --> 00:02:14,083
corralling the store strings
31
00:02:14,083 --> 00:02:17,572
using interface builders auto
32
00:02:18,319 --> 00:02:22,260
layout support and then once the
application is ready
33
00:02:22,026 --> 00:02:25,077
then you can proceed to the second step
34
00:02:25,077 --> 00:02:28,123
localization I should be clear that's
35
00:02:29,023 --> 00:02:32,055
users around the world see your
applications
36
00:02:32,055 --> 00:02:36,056
in very different ways so here's an
37
00:02:36,065 --> 00:02:39,074
English application in the US region
38
00:02:40,055 --> 00:02:44,214
here's the same application in mexico
39
00:02:44,709 --> 00:02:48,000
and you'll notice that in addition to
being in Spanish
40
00:02:48,000 --> 00:02:51,007
it's also got a subtle difference in the
days
41
00:02:51,007 --> 00:02:54,099
here's the same application running in
Spain
42
00:02:55,062 --> 00:02:58,067
also in Spanish but again
43
00:02:59,012 --> 00:03:03,109
with a difference in the dates and the
number formats
44
00:03:04,009 --> 00:03:07,097
so your applications going to have to
handle
45
00:03:07,097 --> 00:03:10,145
these subtleties I'm gonna show you how
46
00:03:11,045 --> 00:03:15,123
first we'll create and internationalize
application
47
00:03:16,023 --> 00:03:21,070
and then later we'll localize it and
getting started
48
00:03:21,007 --> 00:03:27,101
I'd like to introduce you to Chris
Hansen think is also
49
00:03:28,064 --> 00:03:31,119
so as alton said internationalization
50
00:03:32,019 --> 00:03:35,104
is the first step on the route to having
a fully localized application
51
00:03:36,004 --> 00:03:39,023
I'd like to show you how to prepare your
application
52
00:03:39,023 --> 00:03:43,172
and how to leverage Apple spring works
to prepare for localization
53
00:03:43,379 --> 00:03:48,900
so we have some excellent framework
support for internationalization and
54
00:03:48,009 --> 00:03:49,017
localization
55
00:03:49,098 --> 00:03:54,105
in I'll ask analyst 10 and it's
completely pervasive
56
00:03:55,005 --> 00:03:58,006
throughout the system frameworks
otherwise
57
00:03:58,006 --> 00:04:01,011
I don't think we'd be able to localize I
last
58
00:04:01,011 --> 00:04:05,100
into 40 languages and what our system
does
59
00:04:06,000 --> 00:04:09,056
is separate your localize double data
from
60
00:04:09,056 --> 00:04:12,093
the rest of your application thus making
it much
61
00:04:12,093 --> 00:04:15,232
easier to produce localized Burton
62
00:04:16,069 --> 00:04:19,120
variance up your application there are
actually
63
00:04:19,579 --> 00:04:24,330
all built into a single fun
64
00:04:24,033 --> 00:04:27,091
and these localized resources these
localized data
65
00:04:27,091 --> 00:04:30,096
can be images sounds and movies
66
00:04:31,041 --> 00:04:35,720
and documentation in addition to the
user facing taxed
67
00:04:36,089 --> 00:04:40,240
in your application and even the user
facing tax
68
00:04:40,024 --> 00:04:43,503
in your source code and as I said
69
00:04:43,719 --> 00:04:48,180
it's extremely simple to use
70
00:04:48,018 --> 00:04:51,030
now the first step is to start with
71
00:04:51,003 --> 00:04:54,082
NS localized strain
72
00:04:54,379 --> 00:04:57,401
and of localized string lets you
internationalize
73
00:04:57,599 --> 00:05:00,603
strains that are used in your user
interface
74
00:05:00,999 --> 00:05:05,093
but that come from your source code
75
00:05:05,939 --> 00:05:09,400
and the way it Anna localized string
works
76
00:05:09,004 --> 00:05:12,833
it lets you keep nice strings in your
code
77
00:05:13,229 --> 00:05:16,930
such as format strings you don't have to
replace all the nice
78
00:05:16,093 --> 00:05:19,112
readable strings in your code with some
sort of
79
00:05:19,949 --> 00:05:23,014
all uppercase identifiers pointing into
a resource file
80
00:05:23,599 --> 00:05:26,658
instead with annus localized string you
can keep those strings
81
00:05:27,189 --> 00:05:31,210
as they are and still have your
application
82
00:05:31,021 --> 00:05:34,068
fetch localized resources automatically
83
00:05:34,068 --> 00:05:37,507
and that's the important part there's no
explicit
84
00:05:38,119 --> 00:05:41,120
loading our management a very localized
strings needed
85
00:05:41,219 --> 00:05:44,298
at all and
86
00:05:45,009 --> 00:05:48,034
we have a couple variants annus
localized string
87
00:05:48,259 --> 00:05:51,520
such as annus localized string from
Table but you can use
88
00:05:51,052 --> 00:05:54,591
if you do need to keep different string
tables
89
00:05:55,059 --> 00:06:00,140
for different purposes what's just dive
into some code
90
00:06:00,869 --> 00:06:03,960
here we have the kinda format string
91
00:06:03,096 --> 00:06:06,115
little often appear in your code here
I'm just saying
92
00:06:07,015 --> 00:06:13,019
how tall a particular Mountaineers so I
can assign that to a label
93
00:06:13,055 --> 00:06:16,414
now obviously this string is in English
94
00:06:16,909 --> 00:06:21,937
and it's completely on localized and on
international iced
95
00:06:22,189 --> 00:06:27,271
so thats not really great for my users
who use other languages
96
00:06:28,009 --> 00:06:31,036
fortunately all I have to do is wrapped
that
97
00:06:31,279 --> 00:06:36,330
with NS localized spring and adding a
comment explaining what the string is
98
00:06:36,033 --> 00:06:37,232
four
99
00:06:37,529 --> 00:06:40,567
and I've made that code localized
100
00:06:40,909 --> 00:06:44,941
well that comment is important because
it tells you localize urs
101
00:06:45,229 --> 00:06:49,281
your translators just why you're using
map string
102
00:06:49,749 --> 00:06:52,825
because different languages might use
different terminology
103
00:06:53,509 --> 00:06:57,556
based on context so for example
104
00:06:57,979 --> 00:07:00,991
a language might say that a person is
105
00:07:01,099 --> 00:07:04,151
a certain height tall in a completely
different way
106
00:07:04,619 --> 00:07:08,710
than says on mountain as a certain
height
107
00:07:09,529 --> 00:07:13,596
of course that wasn't quite enough we
were using string with
108
00:07:14,199 --> 00:07:17,267
for map we should actually switch
109
00:07:17,879 --> 00:07:20,966
to localized string with format with
that'll do
110
00:07:21,749 --> 00:07:24,750
is it'll insure that when we pass out
that height
111
00:07:24,849 --> 00:07:28,858
as a number but that number is also
properly format
112
00:07:29,749 --> 00:07:32,749
for the user's language and region
113
00:07:32,749 --> 00:07:35,780
including such things as localized
114
00:07:36,059 --> 00:07:40,100
digits because not everybody uses the
same
115
00:07:40,469 --> 00:07:44,488
digit system the same Arabic numerals
that we ate use
116
00:07:44,659 --> 00:07:47,662
in say the United States
117
00:07:47,689 --> 00:07:51,050
and of course as with all of our system
frameworks
118
00:07:51,005 --> 00:07:54,584
missus all available from swift as well
and in fact
119
00:07:54,629 --> 00:07:57,636
I think you'll like how we've are how
we're handling
120
00:07:57,699 --> 00:08:02,761
annus localized string in swept
121
00:08:03,319 --> 00:08:07,320
now those localized strains when you
localize your application into another
122
00:08:07,419 --> 00:08:07,514
language
123
00:08:08,369 --> 00:08:13,407
Morcombe from a dictionary call the
local eyes will strings file
124
00:08:13,749 --> 00:08:18,080
and this is a nice readable file with in
Xcode
125
00:08:18,008 --> 00:08:21,497
where you can specify
126
00:08:21,569 --> 00:08:24,616
all love your localize will strings a
course
127
00:08:25,039 --> 00:08:28,114
salt and will show you how you don't
even have to offer these files yourself
128
00:08:28,789 --> 00:08:32,827
how Xcode will take care of that for you
129
00:08:33,169 --> 00:08:37,270
at the very beginning of a particular
entry in the file
130
00:08:37,027 --> 00:08:40,032
you'll see that comments that you put in
your source code
131
00:08:40,077 --> 00:08:43,118
and naps so somebody who is the
localizing up file
132
00:08:44,018 --> 00:08:47,101
will know just what that spring is for
133
00:08:48,001 --> 00:08:51,030
then the string exactly as it appears in
your code
134
00:08:51,003 --> 00:08:54,058
will show up as a key in that file
135
00:08:54,085 --> 00:08:57,144
and that's how are frameworks
localization system
136
00:08:58,044 --> 00:09:03,049
will look up the string to use in
another language
137
00:09:03,049 --> 00:09:07,102
and finally on the right hand side
you'll see on modified version of that
138
00:09:08,002 --> 00:09:09,046
string
139
00:09:09,046 --> 00:09:12,069
now hear this is Justin English file
140
00:09:12,069 --> 00:09:15,167
but some languages actually use a
different word
141
00:09:16,067 --> 00:09:19,076
order than English and instead of making
you
142
00:09:20,057 --> 00:09:23,133
write some code to say well if I'm using
this language
143
00:09:24,033 --> 00:09:28,036
then I need to pass my arguments to
string what format are localized string
144
00:09:28,063 --> 00:09:29,119
with format in this order
145
00:09:30,019 --> 00:09:33,045
and then in this other language I need
to pass them in a different order
146
00:09:33,045 --> 00:09:36,067
you can pass them all in a stable order
in your code
147
00:09:36,067 --> 00:09:39,155
and you don't have to right anything
language-specific
148
00:09:40,055 --> 00:09:44,063
instead you can use this one dollar sign
in to dollar sign syntax
149
00:09:44,063 --> 00:09:47,090
which Xcode will put in for you
automatically
150
00:09:47,009 --> 00:09:52,066
to indicate what ordered the arguments
comin
151
00:09:53,047 --> 00:09:57,101
and here's an example Justin English how
you might say the same thing
152
00:09:58,001 --> 00:10:01,008
but in a different order and some
languages
153
00:10:01,008 --> 00:10:04,103
world news one order some languages will
use another order
154
00:10:05,003 --> 00:10:08,006
one order might be formal one order
might be informal
155
00:10:08,033 --> 00:10:11,034
it doesn't really matter the point is
156
00:10:11,043 --> 00:10:17,046
that Coco will take care out the heavy
lifting for you
157
00:10:17,073 --> 00:10:21,081
now sorta but the next level of we have
NS formatter
158
00:10:21,081 --> 00:10:24,160
a lot of what your app's do is present
information
159
00:10:25,006 --> 00:10:28,057
from objects to users
160
00:10:29,011 --> 00:10:34,100
an ounce human-readable tax and that's
exactly what for matters are four
161
00:10:35,000 --> 00:10:38,088
for matters actually translate between
162
00:10:38,088 --> 00:10:41,105
objects and human-readable taxed
163
00:10:42,005 --> 00:10:45,007
not just from one to the other
164
00:10:45,007 --> 00:10:49,038
and they can be used to bowl for
presenting and interpreting taxed
165
00:10:49,038 --> 00:10:52,102
so if you're saying getting numeric
input from user
166
00:10:53,002 --> 00:10:56,043
he'll probably want to use the formatter
just as much as you want to use a
167
00:10:56,043 --> 00:10:56,110
formatter
168
00:10:57,001 --> 00:11:01,019
to present numerical output
169
00:11:01,028 --> 00:11:05,028
and for matters use the user's current
locale
170
00:11:05,028 --> 00:11:08,050
the craft language region and other
settings
171
00:11:08,005 --> 00:11:12,088
by default you don't have to do any
special setup or configuration
172
00:11:13,033 --> 00:11:16,090
has hella formatter pay use the user's
173
00:11:16,009 --> 00:11:20,011
specific language and region
174
00:11:20,092 --> 00:11:23,134
so some very simple format or code
175
00:11:24,034 --> 00:11:27,039
dates are actually extremely difficult
176
00:11:27,084 --> 00:11:31,103
format properly for every language in
region in the world
177
00:11:32,003 --> 00:11:35,099
and that's why we built support to them
into our system frameworks
178
00:11:35,099 --> 00:11:40,123
so that everybody doesn't have to do
that work
179
00:11:41,023 --> 00:11:45,114
here we are configuring the formatter to
present a medium-length
180
00:11:46,014 --> 00:11:50,079
date string now that's a date string
that might not have the day of the week
181
00:11:50,079 --> 00:11:53,124
but might present save them on and the
day and the year
182
00:11:54,024 --> 00:11:59,033
only incense and in a state doesn't just
carry a day a year and a month
183
00:11:59,033 --> 00:12:02,033
also carries a time
184
00:12:02,033 --> 00:12:05,059
were telling this formatter that we
actually don't care about the time
185
00:12:05,059 --> 00:12:06,063
that's in the date
186
00:12:06,063 --> 00:12:10,081
we just care about the date portion
other
187
00:12:10,081 --> 00:12:14,138
and of course what we have a formatter
set up we can just keep reusing it
188
00:12:15,038 --> 00:12:19,056
so once we have a date we just need to
pass it through that formatter
189
00:12:19,056 --> 00:12:22,143
using a string from date method in that
case than a state formatter
190
00:12:23,043 --> 00:12:26,114
or in the equivalent method for any
other format urs and we can then
191
00:12:27,014 --> 00:12:30,021
a sign up straight or label
192
00:12:30,084 --> 00:12:33,181
and of course in swift this all looks
very similar
193
00:12:34,081 --> 00:12:37,124
it's actually a little bit more concise
though thanks to Swift
194
00:12:38,024 --> 00:12:41,115
in New Moon syntax now we have for
matters for dates
195
00:12:42,015 --> 00:12:45,050
as I said but we also have for matters
196
00:12:45,005 --> 00:12:49,078
for individual take components and for
time intervals which are also very hard
197
00:12:50,023 --> 00:12:50,076
to get
198
00:12:50,076 --> 00:12:53,079
right now all situations we also have
199
00:12:53,079 --> 00:12:56,144
for matters for numbers and Ford
200
00:12:57,044 --> 00:13:00,044
formatting and number specifically as
currency
201
00:13:00,044 --> 00:13:03,127
which might have slightly different
rules and even for formatting
202
00:13:04,027 --> 00:13:08,125
by counsel such as the number of bytes
or megabytes uploaded for download
203
00:13:09,025 --> 00:13:12,069
that way you don't have to figure out
how to format that properly in your app
204
00:13:12,069 --> 00:13:14,133
stumps out
205
00:13:15,033 --> 00:13:18,131
and new in iowa say and OS 10 yosemite
206
00:13:19,031 --> 00:13:23,105
we have support for for matters for
health related quantities
207
00:13:24,005 --> 00:13:27,042
such as energy in calories in
kilocalories
208
00:13:27,042 --> 00:13:33,080
we have for matters for length and
height we have for matters from mass
209
00:13:33,008 --> 00:13:37,010
and this way you can present this
information consistently to user
210
00:13:37,082 --> 00:13:40,133
with other APs on the system
211
00:13:41,033 --> 00:13:45,051
now underlying all of this is the
concept of a bundle
212
00:13:45,051 --> 00:13:48,123
your caps are actually built into
directories not single files
213
00:13:49,023 --> 00:13:52,095
those directories are called bundles and
that doesn't just cover your caps that
214
00:13:52,095 --> 00:13:55,109
goes here ap extensions and your
frameworks and everything else on a