Skip to content

Commit 8a53a43

Browse files
author
Kureev Alexey
committed
makeStringPatch generate names with prefixes
1 parent 8832d90 commit 8a53a43

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/android/patches/makeStringsPatch.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
module.exports = function makeStringsPatch(params) {
2-
const patch = Object.keys(params).map(key =>
3-
` <string moduleConfig="true" name="${key}">${params[key]}</string>`
1+
const toCamelCase = require('to-camel-case');
2+
3+
module.exports = function makeStringsPatch(params, prefix) {
4+
const patch = Object.keys(params).map(param => ' ' +
5+
'<string moduleConfig="true" ' +
6+
`name="${toCamelCase(`${prefix}-${param}`)}">${params[param]}</string>`
47
).join('\n') + '\n';
58

69
return {

src/android/registerNativeModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function registerNativeAndroidModule(
2424
);
2525

2626
applyPatch(projectConfig.buildGradlePath, buildPatch);
27-
applyPatch(projectConfig.stringsPath, makeStringsPatch(params));
27+
applyPatch(projectConfig.stringsPath, makeStringsPatch(params, name));
2828

2929
applyPatch(
3030
projectConfig.mainActivityPath,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy