-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(cordova/apple/ios): expand import_messages
action to generate iOS strings
#1683
Conversation
Codecov ReportPatch has no changes to coverable lines. 📢 Thoughts on this report? Let us know!. |
import_messages
action to generate iOS stringsimport_messages
action to generate iOS strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just split up the paths for the STRINGS_DIRs, annoying as that is
return str | ||
.replace(/"/g, '\\"') | ||
.replace(/'/g, "\\'") | ||
.replace(/</g, '\\<') | ||
.replace(/>/g, '\\>;') | ||
.replace(/&/g, '\\&'); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding
return str | ||
.replace(/"/g, '\\"') | ||
.replace(/'/g, "\\'") | ||
.replace(/</g, '\\<') |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding
return str | ||
.replace(/"/g, '\\"') | ||
.replace(/'/g, "\\'") |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding
return str | ||
.replace(/"/g, '\\"') |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding
e2c57b0
to
090075e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, just a couple of minor comments/concerns
|
||
function escapeXmlCharacters(str) { | ||
return str | ||
.replace(/"/g, '\\"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we could probably get all of these in a single pass with reduce
other nit: consider replaceAll
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll
@@ -5,6 +5,7 @@ import PackageDescription | |||
|
|||
let package = Package( | |||
name: "OutlineAppleLib", | |||
defaultLocalization: "en", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
@@ -24,6 +20,8 @@ | |||
<string>${PRODUCT_NAME}</string> | |||
<key>CFBundlePackageType</key> | |||
<string>APPL</string> | |||
<key>CFBundleShortVersionString</key> | |||
<string>0.0.0-debug</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should delete this? It's meant to be injected at build time, but I forget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we only inject in release mode, and we do so by search and replacing the string. Don't remove it. It also makes it clearer what to expect in the generated file and what we get in dev.
Though, I think there's a way to specify the version only once for all targets. To be investigated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, looking back at the code, you're right. I wonder how this got removed, maybe it was xcode?
<key>CFBundleShortVersionString</key> | ||
<string>0.0.0-debug</string> | ||
<key>CFBundleVersion</key> | ||
<string>0</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with the bundleversion
).end({format: 'object'}).resources.string; | ||
const ANDROID = 'android'; | ||
const IOS = 'ios'; | ||
const VALID_PLATFORMS = [ANDROID, IOS]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need macos/maccatalyst?
`node-gyp` versions older than v8.0.0 don't work with Python 3.11.
b0c16d4
to
b1eab9b
Compare
No description provided.