如何删除 Android Studio 中所有配置的未使用字符串资源? [英] How to delete an unused string resource for all configurations in Android Studio?

查看:51
本文介绍了如何删除 Android Studio 中所有配置的未使用字符串资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一个未使用的字符串资源,例如:

I've found an unused string resource, like:

<string name="obsoletestring">my name is null!</string>

然而,它是在数十个文件中,不同语言,在不同的 strings.xml 文件中的 valuesvalues-afvalues-be 等文件夹.

However it is in tens of files, of different languages, in different strings.xml files in values, values-af, values-be, etc folders.

我一定是漏掉了一些东西,不知道在 Android Studio 中可以通过什么方法来做到这一点,而不是一一手动修改它.

I must have missed something not to know any way to do this in Android Studio other than modifying it by hand one by one.

tl;dr 如何删除所有配置的未使用字符串资源?

tl;dr How to delete an unused string resource for all configurations?

推荐答案

现在可以在 inside Android Studio 中使用.检查 Lint 后,您会在右侧看到一个选项删除所有未使用的资源

It is now possible inside Android Studio. After Lint checks you see an option on the right Remove All Unused Resources!

要删除所有语言环境文件中的单个字符串资源,您可以使用翻译编辑器".1、右键res目录,打开翻译编辑器.2. 选择显示所有键"选择器,然后选择按文本过滤".提供要删除的资源的名称.3.选择资源,点击-"按钮

To Delete a single string resource across all locale files, you can use the "Translation Editor". 1. Right click on the res directory to open the translation editor. 2. Select "Show All Keys" selector, and choose "Filter by Text". Supply the name of the resource that you want to delete. 3. Select the resource, and click on the "-" button

这篇关于如何删除 Android Studio 中所有配置的未使用字符串资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆