Comments (5)
Thanks again @paulgessinger, this is released in 0.1.1
from xcstrings-tool.
Thanks for raising this @paulgessinger!
I would guess this should actually result in a
UInt
argument?
I've never worked with %u
before, but looking at some reference for printf
, it seems that you are right: https://en.wikipedia.org/wiki/Printf#Type_field
I think that it would be fine to add a uint
case to PlaceholderType
and map to it from "u"
👍
If you feel up for a Pull Request, that would be great! If not, I'll take a look when I get a bit of free time 🙂
from xcstrings-tool.
In fact, it seems like "u"
, "x"
and "o"
should probably be UInt
because sending a negative value using those placeholders results in the what I imagine is the wrong output:
let int: Int = -10
String(format: "%d", int) // -10
String(format: "%i", int) // -10
String(format: "%u", int) // 4294967286
String(format: "%x", int) // fffffff6
String(format: "%X", int) // FFFFFFF6
String(format: "%o", int) // 37777777766
let uint: UInt = 10
String(format: "%d", uint) // 10
String(format: "%i", uint) // 10
String(format: "%u", uint) // 10
String(format: "%x", uint) // a
String(format: "%X", uint) // A
String(format: "%o", uint) // 12
from xcstrings-tool.
Happy to try a PR!
I'm struggling a bit to get the generated swift file since the test generator puts it in a temporary directory that gets deleted right after the test run it seems.
I tried changing the target location to CWD temporarily but that seems to give an empty for somehow.
EDIT: I found the teardown block...
from xcstrings-tool.
Ah yes, I will have to try and remember how I implemented the testing infra 😅 I'll add a note to write some instructions for future contributors 🙏
from xcstrings-tool.
Related Issues (20)
- Keys which are Swift keywords can't be compiled HOT 1
- Add public for package HOT 2
- Sendable conformance HOT 7
- Integrating XCStrings Tool into a Swift Package Target has wrong package git url HOT 2
- ExtractionState config HOT 3
- Demonstrate use of language overrides in documentation HOT 3
- Feature Suggestion: Support to other build systems HOT 1
- Default values with UnsafeRawPointers do not compile HOT 4
- Ensure that snapshots compile
- Multiple commands produce generated source when working with embedded watchOS app HOT 5
- Generate.swift in the Release files look different HOT 3
- Support SwiftSyntax 5.10
- Improve SwiftUI support on iOS 15 HOT 16
- String containing a single `%` is parsed incorrectly HOT 1
- Duplicates in Localizable.xcstrings in 0.2.0 HOT 9
- Set default value to be fallback documenting comment HOT 2
- Suggestion/Question init LocalizedStringKey with .localizable.key HOT 8
- How to use with Github Actions? HOT 3
- Duplicate accessors generated in extensions on both `String` and `LocalizedStringResource`
- Support deferred formatting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcstrings-tool.