{"id":19442421,"url":"https://github.com/ackeecz/spreadsheet-localizer-plugin","last_synced_at":"2025-04-25T00:31:49.600Z","repository":{"id":67869460,"uuid":"149734362","full_name":"AckeeCZ/Spreadsheet-Localizer-Plugin","owner":"AckeeCZ","description":"Android Studio plugin that loads string resources from Google Spreadsheet","archived":false,"fork":false,"pushed_at":"2024-03-19T11:28:47.000Z","size":237,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-15T00:06:28.917Z","etag":null,"topics":["android","android-studio-plugin","google-spreadsheet"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AckeeCZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-09-21T08:34:03.000Z","updated_at":"2024-04-15T00:06:28.918Z","dependencies_parsed_at":null,"dependency_job_id":"bdd182c3-3d8c-448e-b350-e501be115ed3","html_url":"https://github.com/AckeeCZ/Spreadsheet-Localizer-Plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2FSpreadsheet-Localizer-Plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2FSpreadsheet-Localizer-Plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2FSpreadsheet-Localizer-Plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2FSpreadsheet-Localizer-Plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AckeeCZ","download_url":"https://codeload.github.com/AckeeCZ/Spreadsheet-Localizer-Plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223974805,"owners_count":17234719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-studio-plugin","google-spreadsheet"],"created_at":"2024-11-10T15:39:15.400Z","updated_at":"2024-11-10T15:39:16.023Z","avatar_url":"https://github.com/AckeeCZ.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spreadsheet-Localizer-Plugin\nAndroid Studio plugin that loads string resources from Google Spreadsheet\n\n## Installation and usage\nYou can install the plugin to your Android Studio directly from the JetBrains plugin repository as \"Spreadsheet Localizer\" or you can of course build and deploy the plugin directly from the source code using the gradle wrapper ```./gradlew buildPlugin```. The plugin then adds the action to \"Load localization strings\" (little globe icon) to your main toolbar. When you trigger this action the settings dialog with the following properties is shown.\n\n1. Project/project name - you may have multiple projects with different configurations.\n2. Config file path - path to config JSON file which provides configuration for project localizations. \n\nThose properties are then saved in the ```$PROJECT_DIR$/.idea/localizerSettings.xml``` file. It is recommended to add this file to your VCS to allow other developers to easily download fresh dependencies without another configuration needs.\n\n## Configuration file\n\nYou should provide configuration JSON file for your project. It is separated from the plugin and may be consumed by some other service (e.g. Gradle script).\n\nThe structure of this JSON is described in the example:\n\n```json\n{\n  \"fileId\": \"1122334455\", // The unique identifier of your Google Sheets file - it is the hash part of the URL\n  \"sheetName\": \"Sheet 1\", // The name of particular sheet in your file\n  \"apiKey\": \"AIza112233\", // Google Spreadsheets API, available in your Google developers console\n  \"serviceAccountPath\": \"localizer/service-account.json\",\n  // Service Account specification json\n  \"languageMapping\": { // Mapping between the column in the sheet and Android values folder suffix\n    \"EN\": null, // null means that the language is default, localizations will be saved to \"values\" folder\n    \"CZ\": \"cs\",\n    \"FR-FR\": \"fr-rFR\" // E.g. the column name is \"FR-FR\", the localizations will be saved to \"values-fr-rFR\" folder\n  },\n  \"resourcesFolderPath\": \"libraries/translations/src/main/res\" // Relative path to your \"res\" folder with respect to json configuration path\n  \"supportEmptyStrings\": false // Enables to support empty strings in the localization sheet\n}\n```\n\nNote: in previous versions of Spreadsheet localizer plugin this configuration was stored directly in plugin settings\n\n### Empty strings\nPlugin has a configurable option to either support or not support empty strings in the localization sheet. This can be\nconfigured via `supportEmptyStrings` attribute. When set to `true`, it takes empty strings from the localization sheet and\ngenerates them to the XML file. When set to `false`, it just discards any empty strings found in the sheet. `supportEmptyStrings`\ncan be omitted from the configuration JSON for backwards compatibility and defaults to `false` in that case to preserve\na previous behaviour.\n\n## Spreadsheet structure\nThe localization plugin of course depends on a predefined Google sheet structure. These are the rules the spreadsheet must follow for the plugin to work correctly:\n\n1. The optional \"Section\" column. Based on values from this column the plugin visually separates the logical chunks of your resources (usually screens).The row containing section name shouldn't contain anything else.\n2. The column \"key_android\" - the resource keys for your strings.xml should be put here\n4. Locale columns (e.g. \"en\", \"de\", \"cs\") - contain actual translations. Base on config file they are mapped to resource files in corresponding \"values\" folders.\n\n## Formatting params and plurals support\nThe translations can of course contain all the formatting symbols like %s or %1$d to correctly support the strings formatting. It is also possible to include the HTML tags in the strings. All these symbols are correctly escaped and usable in the resources files.\n\nThe plurals support is achieved using the special key formatting. You can specify plural key in a format key##{amount} which is then correctly translated into the plurals elements.\n\n## Authorization\n\nThere are two ways this plugin can authorize towards a spreadsheet\n\n- API key. This requires to create a new API key in Google console. This approach has disadvantage that a spreadsheet\n  must be public for read\n- service account. This requires to create a new Service account within Google Console. Then the spreadsheet does not\n  have to be public and the service account must have access to this file\n\n## Example spreadsheet\n\nYou can find the example\nspreadsheet [here](https://docs.google.com/spreadsheets/d/1Z5g7bHavCe1YKnnpLcGiaKbO0OOQB5VctPvACUQVDMs/edit#gid=0) and\ntest it in your project with the localizerSettings.xml like this:\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cproject version=\"4\"\u003e\n  \u003ccomponent name=\"LocalizerSettings\"\u003e\n    \u003coption name=\"projects\"\u003e\n      \u003clist\u003e\n        \u003cProjectSettings\u003e\n          \u003coption name=\"projectName\" value=\"MyProject\" /\u003e\n          \u003coption name=\"resPath\" value=\"$PROJECT_DIR$\\localization_config.json\" /\u003e\n        \u003c/ProjectSettings\u003e\n      \u003c/list\u003e\n    \u003c/option\u003e\n  \u003c/component\u003e\n\u003c/project\u003e\n```\n\n## Changelog\n- `1.2.1`\n  - Fix plugin min and max IDE versions support\n- `1.2.0`\n  - Support for including empty strings from localization sheet to the generated XML file\n- `1.1.0`\n  - Support for service accounts authentication\n- `1.0.0` \n    - ⚠️ BREAKING CHANGE ⚠️\n    - Configuration is moved to separate JSON which now needs to be provided\n    - Language mapping support: column keys may be mapped to values suffixes instead of using limited amount of supported languages. `null` suffix means default language.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fackeecz%2Fspreadsheet-localizer-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fackeecz%2Fspreadsheet-localizer-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fackeecz%2Fspreadsheet-localizer-plugin/lists"}