# Localize Interpolated String: Why Only String Value Work?

**URL:** <https://forums.swift.org/t/localize-interpolated-string-why-only-string-value-work/27528>\
**Category:** Using Swift\
**Created:** [August 1, 2019, 11:54pm UTC](https://forums.swift.org/t/localize-interpolated-string-why-only-string-value-work/27528 "2019-08-01T23:54:27Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![1oo7](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/1oo7/32/17598_2.png) [@1oo7](https://forums.swift.org/u/1oo7)\
**Post date:** [April 11, 2021, 3:16am UTC](https://forums.swift.org/t/localize-interpolated-string-why-only-string-value-work/27528/11 "2021-04-11T03:16:41Z")

</div>

> So only `_FormatSpecifiable` can supply a `specifier` and `_FormatSpecifiable` is not public, these `_FormatSpecifiable` must be fixed, so regular user cannot add their own. Aren't they just whatever `NSLocalizedString` allow?

Sorry to revive this old post but, in case anyone else ends up here trying to solve the same kind of problem, I'd like to explain something.

`_FormatSpecifiable` is a public protocol. It is however _undocumented_. (It's impossible to have a non-public protocol in a public API.)

The actual public protocol is:

```swift
public protocol _FormatSpecifiable : Swift.Equatable {
  associatedtype _Arg : Swift.CVarArg
  var _arg: Self._Arg { get }
  var _specifier: Swift.String { get }
}

```

It's found in SwiftUI's swiftinterface file:  
`/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SwiftUI.framework/Modules/SwiftUI.swiftmodule/arm64e-apple-ios.swiftinterface`

You can see the public interface for how they have implemented it for stdlib types:

```swift
extension Int : SwiftUI._FormatSpecifiable {
  public var _arg: Swift.Int64 {
    get
  }
  public var _specifier: Swift.String {
    get
  }
  public typealias _Arg = Swift.Int64
}

```

Knowing this you could go into a playground and simply:

```swift
print(42._arg) // prints 42
print(42._specifier) // prints %lld
print(CGFloat(42)._arg) // prints 42.0
print(CGFloat(42)._specifier) // prints %lf

```

Etc.

However given that there is no documentation about this and its types have been marked with `_` meaning, "for Apple's use only", I would recommend to not conform to this, or if you need to use it, then file developer support ticket and/or a feedback assistant issue to and see if we can ask them to make this public and document it.

---

_[View the full topic](https://forums.swift.org/t/localize-interpolated-string-why-only-string-value-work/27528)._
