LoginSignup
3
1

More than 1 year has passed since last update.

SwiftUIでTextに変数が埋め込んである場合のローカライズ

Posted at

前提

  • SwiftUIのローカライズの仕組みを理解していること
  • Localizable.stringsは定義済みであること。

実装方法

変数部分を%@で置き換えると、変数が埋め込んであってもローカライズできます。

Localizable.strings
"current launguage: %@" = "現在の言語: %@";
HogeView.swift
Text("current language: \(currentLanguage)")
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1