As an application grows, maintaining the same product communication gets harder on multiple platforms. Stringer solves this problem by generating platform specific string files from a common CSV file.
Currently, the generated files include strings.xml
for Android and localizable.strings
for iOS.
Run kscript stringer.kt <Path to your csv file>.csv
. Files will be generated in a directory named StringerThings
on the same path.
See kscript for installation and more information.
OR
- Create the csv named
mobile-strings.csv
and place it in$homeDirectory/Downloads
. The resulting file path should be$homeDirectory/Downloads/strings.csv
(default path of a downloaded file). - Execute
main()
function. - The generated files are located in
$homeDirectory/Desktop/StringerThings
directory.
See sample csv for format.
- Templating is supported: Any string between
<
and>
will be replaced with%s
for Android and%@
for iOS. - Any line starting with
#
is treated as comment. - A
type
andfeature
can be provided and resource key is generated accordingly for them. Eg: The generated key forno connection, No internet connection found, ERROR, user details
will beerror_user_details_no_connection
.
Note: Ordering matters. CSVs must be ordered as `KEY, ENGLISH VALUE, FOREIGN VALUE'
Copyright 2019 Gurpreet Singh
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.