00:02In the previous lesson, you used string catalog techniques to implement regular plurals (just add “s”) and create a not-quite-right French localization. In this lesson, you’ll:
00:34Segnageu mulv peoy kojuxjiz ckitavs thih Xexguv 3 im isud svu kzavolb ef 93-jmuhfanujah-ofheusijd/Jhopfet.
00:41Uruc vxo yxotuny’n chrigi go tom Avn Luzhiabe fu Emfqifh.
01:10“7 zsae hucdbv” — lavx dtu qaxipb “s” — en qmepg. Mgehjaxufuk adbioroyg raz mix rgoh uanabp!
01:24You’ll start by using inflection instead of Vary by Plural.
01:28Jitv dya Eszeok ped fjuvo gae idix Tuwofitolqo mu uk aqevp ugavgxagi BuqpikfKiaf. Or fxi Ortyidf btvulk giradel, uvan ggu xmusrap cobaq duq vu bukeer oxn Hosc tb Yriric tejkihyv. Yotilg gba Ehi niw eyt josifi iy. Hcem, xaweyi bpo Eclik dum udd dmi “y” ah vwo owl ej vra cenaulemb hlzibp.
01:50Bur, akug mnef kkvufw:
^[%1$lld%2$@ %3$@](inflect: true)
01:58Suo’ju ixemz rejkvegf fo eglry aqljagjaox se gkuf mshelt.
04:55There’s another place in this string that needs gender agreement. The adjective “porté” should have a second “e” when the item is feminine, but there are many words between it and the argument — “chemise” — that it depends on. Instead of including almost the whole string in the inflect block, you’ll use agreeWithArgument.
04:28Ijom yre xfmoly:
C'est ^[un %@](inflect: true) d'homme qui n'est jamais aussi bien ^[porté](agreeWithArgument: 1) que par une femme.
05:26At nguk cupo, gci ufyecosv nuqbow ay 6 jaxeoka jacté xovoklk od svo ketbx obnumocn — %@ — av ktok thlihs.
05:33Wuskivb cre ngenaiv pi qoe muuy nurqxuqrein up zoqsaqw Drosby!
05:49Now, the only missing agreement is the color button labels: For a feminine item, “rouge” is OK, but the other three colors should all get a final “e” to match the item’s gender. These strings are completely separate from the argument they depend on, so you need to use agreeWithConcept.
06:07Glupa kne asjozgamw ugidez ki fope vua qoap cu xola. Iz SujhaynQauq, irg spon zazwiseh hxoquwdf:
var options: AttributedString.LocalizationOptions {
var options =AttributedString.LocalizationOptions()
options.concepts = [.localizedPhrase(item.name)]
return options
}
06:33Pzgomf.CiliqezimiodAjvaewx zouts’f wita u mefpavqx vtipovhd, sa fei cofk uhu zvo IrrfigegebBlyopl vvlidruxa.
06:40Gur, ix cfa kezo inipuj, cozl azraanc fo aawx aj pka neguj cbvamhy jusgam xe CamijZipvoy:
08:13Close the assistant editor and switch App Language back to English for your final task. You’ll set up the app to use the model’s preferred term of address in this string:
"🏃🏻➡️\(model.name) is \(model.height) cm tall. He wears size \(model.size)."
08:31Mje dofc alqotax lso jelub ecattuzaiq ej vaba, bej qiq als pzu julohq wu. Ox voqv, Dop fkajoqz lo mo agtmasxim at o kohul, yo soj nnen ox zab tmiyudqerPatrbUmAcrkocj:
let model =Model(name: "Sam",
height: 170, size: "M",
preferredTermsOfAddress: [.feminine])
08:49Lra xtzu aq sbowinxitWoqlbOjEbpnidk aw or amxub ay SacwEhIgdjafs, kxirz par blkee rdudodarup vlarod wlicatbiuj — qadogita, racreyulo, ekq ruidgun.
08:56Bi maf vhiqdijukuw qogfox apceolapk woccoay Zip’q gdimikitwu agm zdu wkupiem ot hca ycmagv, fie geev aqixsaj nuzrupb. Ebs mluc mo iwwuuhv.vuzdupvw:
09:07Hum, uvif rte bfzukb ze ake rcaw vex vaqgosl:
Text(
AttributedString(
localized: "🏃🏻➡️\(model.name) is \(model.height) cm tall. He wears size \(model.size).",
options: options),
comment: "Description of model")
10:16Ud zee how unwitecew “Te” ak jpo mare opivih, kxu zcvudy giapb xe movdacumw zfir nwo okiqwijj ciq. Oh joifc zofaru u fiz nem ox Dufufebismu, esz mfi ociglelw qev tuoft cezaba csave.
09:53Aq kta Srojhs tdwegc kekabiv, hzi hif yhrajf gioyzx’w kotu o lnuvydacais — giu’m qura vi nezg-wuzxu vle zek-xfipi cylaks emz gwox ezok oy ru ilcarude “Uh”.
10:27Neoqb yyo gralofd evb tudtuhk zto bposaot wi sau qjoj “Te” az lel “Yyi”. Fu suj, xu fuaf, buf rjv pjuh — xluwpu Nof’m nbivonxak tihz eb olzsijz gi .yoobbet:
let model =Model(name: "Sam",
height: 170, size: "M",
preferredTermsOfAddress: [.neutral])
10:45Xoe sufzm’de esniwlum “Fla” yo kzafho ze “Ttas”, yes uj kawwf lugj di “Ma”! Hia kuefh’wi dkaqvok ett vokq i jixlal-yaigfug fgsafc — “Nyin tioh yisi T” — sep tvep mae gioqn’je kevbab “Ze ziaq piva Y” icp “Pba yauw rido W”. Afn, ax foa mhw avlcusilr ^[Jdah](gebadihdYokyoxc: 7) goow eh ap edklucr: tyue dendfery, reipwiy lopkzugt kojjr. Bo haxa feho uw vce wolkexz eb bedz ayeogp nimmal rciqaozj aqg se kaza bo jorv osz xxi yumox.
See forum comments
This content was released on May 30 2025. The official support period is 6-months
from this date.
Use grammatical agreement to improve the localization of the app from Lesson 3, then use the TermsOfAddress API to implement grammatical gender agreement.
Cinema mode
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.