Skip to content

Commit f7e1dec

Browse files
feat: initial project structure for Android String File Localization
- Implemented core translation and XML merging logic - Added background task handling and PSI-based file searching - Integrated i18n support via MyBundle.properties - Configured plugin.xml and build.gradle.kts for AS Ladybug+ - Added README, LICENSE, and GitHub Issue Templates
1 parent 83f52a2 commit f7e1dec

19 files changed

Lines changed: 774 additions & 160 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: "🐛 Bug Report"
3+
about: "Report a bug to help improve Android String File Localization"
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: sundramsinghdev007
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
1. Right click on '...'
15+
2. Click on 'Android String File Localization'
16+
3. Enter language code '...'
17+
4. See error
18+
19+
**Expected Behavior**
20+
A clear description of what you expected to happen.
21+
22+
**Screenshots**
23+
If applicable, add screenshots to help explain your problem.
24+
25+
**Environment:**
26+
- Android Studio Version: [e.g. Ladybug 2024.2.1]
27+
- Plugin Version: [e.g. 1.0.0]
28+
- OS: [e.g. Windows, macOS]
29+
30+
**Additional Context**
31+
Add any other context about the problem here (e.g., specific string characters that caused the failure).
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: "🚀 Feature Request"
3+
about: "Suggest an idea for Android String File Localization"
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: sundramsinghdev007
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional Context**
19+
Add any other context or screenshots about the feature request here.

.idea/gradle.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
<!-- Keep a Changelog guide -> https://keepachangelog.com -->
1+
# Changelog
22

3-
# string_and_assets_cleaner Changelog
4-
5-
## [Unreleased]
3+
## [1.0.0] - 2026-03-08
64
### Added
7-
- Initial scaffold created from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)
5+
- Initial release of Android String File Localization.
6+
- **Automated Translation:** Support for Google Translate engine integration.
7+
- **Smart UI:** Searchable string list with English previews.
8+
- **Tools Menu Integration:** Access the plugin even when no files are open.
9+
- **Selection Logic:** "Select All", "Deselect All", and "Force Update" functionality.
10+
- **Sanitization:** Auto-escaping of apostrophes and removal of NBSP characters.
11+
- **Internationalization:** Plugin UI ready for multiple languages via `MyBundle`.
12+
- **Background Tasks:** Non-blocking translation with progress indicator.
13+
14+
### Fixed
15+
- Fixed "Apostrophe not preceded by \" build errors.
16+
- Resolved IDE stutters by moving update logic to Background Thread (BGT).

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 sundramsinghdev007
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,77 @@
1-
# string_and_assets_cleaner
1+
# Android String File Localization 🌍
22

3-
![Build](https://github.com/sundramsinghdev007/string_and_assets_cleaner/workflows/Build/badge.svg)
4-
[![Version](https://img.shields.io/jetbrains/plugin/v/MARKETPLACE_ID.svg)](https://plugins.jetbrains.com/plugin/MARKETPLACE_ID)
5-
[![Downloads](https://img.shields.io/jetbrains/plugin/d/MARKETPLACE_ID.svg)](https://plugins.jetbrains.com/plugin/MARKETPLACE_ID)
3+
**Android String File Localization** is a productivity-focused IntelliJ/Android Studio plugin designed to streamline the localization process. It automates the translation of `strings.xml` files while ensuring the output is sanitized and 100% compliant with Android build requirements.
64

7-
## Template ToDo list
8-
- [x] Create a new [IntelliJ Platform Plugin Template][template] project.
9-
- [ ] Get familiar with the [template documentation][template].
10-
- [ ] Adjust the [pluginGroup](./gradle.properties) and [pluginName](./gradle.properties), as well as the [id](./src/main/resources/META-INF/plugin.xml) and [sources package](./src/main/kotlin).
11-
- [ ] Adjust the plugin description in `README` (see [Tips][docs:plugin-description])
12-
- [ ] Review the [Legal Agreements](https://plugins.jetbrains.com/docs/marketplace/legal-agreements.html?from=IJPluginTemplate).
13-
- [ ] [Publish a plugin manually](https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html?from=IJPluginTemplate) for the first time.
14-
- [ ] Set the `MARKETPLACE_ID` in the above README badges. You can obtain it once the plugin is published to JetBrains Marketplace.
15-
- [ ] Set the [Plugin Signing](https://plugins.jetbrains.com/docs/intellij/plugin-signing.html?from=IJPluginTemplate) related [secrets](https://github.com/JetBrains/intellij-platform-plugin-template#environment-variables).
16-
- [ ] Set the [Deployment Token](https://plugins.jetbrains.com/docs/marketplace/plugin-upload.html?from=IJPluginTemplate).
17-
- [ ] Click the <kbd>Watch</kbd> button on the top of the [IntelliJ Platform Plugin Template][template] to be notified about releases containing new features and fixes.
18-
- [ ] Configure the [CODECOV_TOKEN](https://docs.codecov.com/docs/quick-start) secret for automated test coverage reports on PRs
5+
## What It Is
196

20-
<!-- Plugin description -->
21-
This Fancy IntelliJ Platform Plugin is going to be your implementation of the brilliant ideas that you have.
7+
A lightweight but powerful IntelliJ IDEA/Android Studio plugin that identifies missing translations in your Android project and fills them using automated translation services. It handles the "heavy lifting" of creating directories, managing XML tags, and sanitizing text for Android compatibility.
228

23-
This specific section is a source for the [plugin.xml](/src/main/resources/META-INF/plugin.xml) file which will be extracted by the [Gradle](/build.gradle.kts) during the build process.
9+
## ✨ Why use this?
2410

25-
To keep everything working, do not remove `<!-- ... -->` sections.
26-
<!-- Plugin description end -->
11+
Manual translation is slow and error-prone. This plugin solves the most common headaches:
2712

28-
## Installation
13+
* **No more "Apostrophe" crashes:** Automatically escapes `'` to `\'` so your app actually builds.
14+
* **Invisible Character Removal:** Cleans out `NBSP` (Non-Breaking Spaces) that often hide in web-copied text and break UI layouts.
15+
* **Zero-Loss Merging:** It doesn't overwrite your work; it merges new translations into existing localized files.
2916

30-
- Using the IDE built-in plugin system:
17+
---
18+
19+
## 🛠 Features
20+
21+
* **Smart Search:** Quickly find specific keys or English phrases in your resource files.
22+
* **Contextual Previews:** Displays original English text alongside keys for better translation context.
23+
* **Bulk Selection Logic:** * **Smart Select:** Picks only missing translations.
24+
* **Force Update:** Re-translates everything to refresh your language files.
25+
26+
27+
* **Translatable Guard:** Automatically respects and protects strings marked `translatable="false"`.
28+
* **Tools Menu Integration:** Accessible via `Tools > Translate Strings...` or via right-click context menus.
3129

32-
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "string_and_assets_cleaner"</kbd> >
33-
<kbd>Install</kbd>
30+
---
31+
32+
## 📖 How to Use
33+
34+
### 1. Launching the Plugin
3435

35-
- Using JetBrains Marketplace:
36+
You can trigger the tool from three locations:
3637

37-
Go to [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/MARKETPLACE_ID) and install it by clicking the <kbd>Install to ...</kbd> button in case your IDE is running.
38+
* **The Tools Menu:** `Tools` -> `Translate Strings...`
39+
* **The Project Tree:** Right-click on any `strings.xml`.
40+
* **The Editor:** Right-click inside your code and select the translation action.
3841

39-
You can also download the [latest release](https://plugins.jetbrains.com/plugin/MARKETPLACE_ID/versions) from JetBrains Marketplace and install it manually using
40-
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>
42+
### 2. Selection Strategy
4143

42-
- Manually:
44+
1. **Enter Language Code:** Type the ISO code (e.g., `hi` for Hindi, `es` for Spanish).
45+
2. **Filter & Select:** Use the search bar to find keys. Use **Select All** to grab missing strings.
46+
3. **Execute:** Click **OK**. Watch the progress in the bottom-right background task bar.
47+
4. **Completion:** A success balloon notification will confirm how many strings were updated.
48+
49+
---
50+
51+
## 🏗 Installation
52+
53+
### Manual Install
54+
55+
1. Download the latest `plugin.zip` from the [Releases](https://www.google.com/search?q=https://github.com/sundramsinghdev007/Android-String-File-Localization/releases) section.
56+
2. Open Android Studio -> `Settings` -> `Plugins`.
57+
3. Click the ⚙️ (Gear Icon) -> **Install Plugin from Disk...**.
58+
4. Select the `.zip` file and restart.
59+
60+
---
61+
62+
## 💻 Tech Stack
63+
64+
* **Language:** Kotlin
65+
* **Framework:** IntelliJ Platform SDK
66+
* **Target:** Android Studio (Ladybug 2024.2.1+)
67+
* **Architecture:** MVVM-inspired UI with Background Thread (BGT) action updates.
68+
69+
---
4370

44-
Download the [latest release](https://github.com/sundramsinghdev007/string_and_assets_cleaner/releases/latest) and install it manually using
45-
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>
71+
## 📄 License
4672

73+
This project is licensed under the **MIT License**. See the [LICENSE](/LICENSE.txt) file for more details.
4774

4875
---
49-
Plugin based on the [IntelliJ Platform Plugin Template][template].
5076

51-
[template]: https://github.com/JetBrains/intellij-platform-plugin-template
52-
[docs:plugin-description]: https://plugins.jetbrains.com/docs/intellij/plugin-user-experience.html#plugin-description-and-presentation
77+
Thanks to this repo [intellij-platform-plugin-template](https://github.com/JetBrains/intellij-platform-plugin-template) which helps to set-up the project.

build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ dependencies {
3636

3737
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
3838
intellijPlatform {
39-
intellijIdea(providers.gradleProperty("platformVersion"))
40-
39+
// intellijIdea(providers.gradleProperty("platformVersion"))
40+
androidStudio(providers.gradleProperty("androidPlatformVersion"))
4141
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
4242
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
4343

@@ -85,7 +85,9 @@ intellijPlatform {
8585

8686
ideaVersion {
8787
sinceBuild = providers.gradleProperty("pluginSinceBuild")
88+
untilBuild = providers.gradleProperty("pluginUntilBuild")
8889
}
90+
8991
}
9092

9193
signing {
@@ -101,7 +103,7 @@ intellijPlatform {
101103
// https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html#specifying-a-release-channel
102104
channels = providers.gradleProperty("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
103105
}
104-
106+
instrumentCode = false
105107
pluginVerification {
106108
ides {
107109
recommended()

gradle.properties

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
2-
3-
pluginGroup = com.github.sundramsinghdev007.stringandassetscleaner
4-
pluginName = string_and_assets_cleaner
5-
pluginRepositoryUrl = https://github.com/sundramsinghdev007/string_and_assets_cleaner
2+
pluginGroup=com.github.sundramsinghdev007
3+
pluginName=Translate Strings
4+
pluginRepositoryUrl=https://github.com/sundramsinghdev007/string_and_assets_cleaner
65
# SemVer format -> https://semver.org
7-
pluginVersion = 0.0.1
8-
6+
pluginVersion=1.0.0
97
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
10-
pluginSinceBuild = 252
11-
8+
pluginSinceBuild=242
9+
pluginUntilBuild=252.*
10+
#pluginSinceBuild = 252
1211
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
13-
platformVersion = 2025.2.5
14-
12+
platformVersion=2025.2.5
13+
androidPlatformVersion=2024.2.2.13
1514
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1615
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
17-
platformPlugins =
16+
platformPlugins=
1817
# Example: platformBundledPlugins = com.intellij.java
19-
platformBundledPlugins =
18+
platformBundledPlugins=org.jetbrains.android
2019
# Example: platformBundledModules = intellij.spellchecker
21-
platformBundledModules =
22-
20+
platformBundledModules=
2321
# Gradle Releases -> https://github.com/gradle/gradle/releases
24-
gradleVersion = 9.3.1
25-
22+
gradleVersion=9.3.1
2623
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
27-
kotlin.stdlib.default.dependency = false
28-
24+
kotlin.stdlib.default.dependency=false
2925
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
30-
org.gradle.configuration-cache = true
31-
26+
org.gradle.configuration-cache=true
3227
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
33-
org.gradle.caching = true
28+
org.gradle.caching=true

src/main/kotlin/com/github/sundramsinghdev007/stringandassetscleaner/services/MyProjectService.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/main/kotlin/com/github/sundramsinghdev007/stringandassetscleaner/startup/MyProjectActivity.kt

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)