mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[i18n] move properties used in platform.credentialStore module to a separate bundle (IDEA-209382)
GitOrigin-RevId: 057bb93bcc21df1d8fcc9102dcf440bd08aa3119
This commit is contained in:
committed by
intellij-monorepo-bot
parent
35d24fe88a
commit
dd640b843d
@@ -5,6 +5,7 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="com.intellij.credentialStore" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" packagePrefix="com.intellij.credentialStore" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
password.safe.configurable=Passwords
|
||||
passwordSafeConfigurable.are.you.sure=Are you sure want to remove all passwords?
|
||||
passwordSafeConfigurable.clear.passwords=Clear Passwords
|
||||
passwordSafeConfigurable.do.not.save=Do not save, forget passwords after restart
|
||||
passwordSafeConfigurable.in.keepass=In KeePass
|
||||
passwordSafeConfigurable.in.native.keychain=In native Keychain
|
||||
passwordSafeConfigurable.keepass.database.file=KeePass Database File
|
||||
passwordSafeConfigurable.no.keys.configured=(No keys configured)
|
||||
passwordSafeConfigurable.protect.master.password.using.pgp.key=Protect master password using PGP key
|
||||
passwordSafeConfigurable.remove.passwords=Remove Passwords
|
||||
passwordSafeConfigurable.save.password=Save passwords:
|
||||
passwordSafeConfigurable.weak.encryption=Stored using weak encryption. It is recommended to store on encrypted volume for additional security.
|
||||
settings.password.change.master.password=Change Master Password
|
||||
settings.password.database=Database:
|
||||
settings.password.internal.error=Internal error: {0}
|
||||
settings.password.keepass.database.file.is.directory.=KeePass database file is directory.
|
||||
settings.password.keepass.database.file.should.ends.with.kdbx=KeePass database file should ends with ".kdbx".
|
||||
settings.password.keepass.database.path.is.empty=KeePass database path is empty.
|
||||
settings.password.master.password.for.keepass.database.is.not.correct=Master password for KeePass database is not correct ("Clear" can be used to reset database).
|
||||
22
platform/credential-store/src/CredentialStoreBundle.kt
Normal file
22
platform/credential-store/src/CredentialStoreBundle.kt
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.credentialStore
|
||||
|
||||
import com.intellij.DynamicBundle
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import org.jetbrains.annotations.PropertyKey
|
||||
import java.util.function.Supplier
|
||||
|
||||
@NonNls
|
||||
private const val BUNDLE = "messages.CredentialStoreBundle"
|
||||
|
||||
object CredentialStoreBundle : DynamicBundle(BUNDLE) {
|
||||
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String,
|
||||
vararg params: Any): String {
|
||||
return getMessage(key, *params)
|
||||
}
|
||||
|
||||
fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String,
|
||||
vararg params: Any): Supplier<String> {
|
||||
return getLazyMessage(key, *params)
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ import javax.swing.JPanel
|
||||
import javax.swing.JRadioButton
|
||||
|
||||
internal class PasswordSafeConfigurable : ConfigurableBase<PasswordSafeConfigurableUi, PasswordSafeSettings>("application.passwordSafe",
|
||||
IdeBundle.message("password.safe.configurable"),
|
||||
CredentialStoreBundle.message("password.safe.configurable"),
|
||||
"reference.ide.settings.password.safe") {
|
||||
private val settings = service<PasswordSafeSettings>()
|
||||
|
||||
@@ -141,7 +141,7 @@ internal class PasswordSafeConfigurableUi(private val settings: PasswordSafeSett
|
||||
}
|
||||
catch (e: Exception) {
|
||||
LOG.error(e)
|
||||
throw ConfigurationException(IdeBundle.message("settings.password.internal.error", e.message))
|
||||
throw ConfigurationException(CredentialStoreBundle.message("settings.password.internal.error", e.message ?: e.toString()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,14 +158,14 @@ internal class PasswordSafeConfigurableUi(private val settings: PasswordSafeSett
|
||||
// for KeePass not clear - should we append in-memory credentials to existing database or not
|
||||
// (and if database doesn't exist, should we append or not), so, wait first user request (prefer to keep implementation simple)
|
||||
private fun createAndSaveKeePassDatabaseWithNewOptions(settings: PasswordSafeSettings) {
|
||||
val newDbFile = getNewDbFile() ?: throw ConfigurationException(IdeBundle.message("settings.password.keepass.database.path.is.empty"))
|
||||
val newDbFile = getNewDbFile() ?: throw ConfigurationException(CredentialStoreBundle.message("settings.password.keepass.database.path.is.empty"))
|
||||
if (newDbFile.isDirectory()) {
|
||||
// we do not normalize as we do on file choose because if user decoded to type path manually,
|
||||
// it should be valid path and better to avoid any magic here
|
||||
throw ConfigurationException(IdeBundle.message("settings.password.keepass.database.file.is.directory."))
|
||||
throw ConfigurationException(CredentialStoreBundle.message("settings.password.keepass.database.file.is.directory."))
|
||||
}
|
||||
if (!newDbFile.fileName.toString().endsWith(".kdbx")) {
|
||||
throw ConfigurationException(IdeBundle.message("settings.password.keepass.database.file.should.ends.with.kdbx"))
|
||||
throw ConfigurationException(CredentialStoreBundle.message("settings.password.keepass.database.file.should.ends.with.kdbx"))
|
||||
}
|
||||
|
||||
settings.keepassDb = newDbFile.toString()
|
||||
@@ -174,11 +174,11 @@ internal class PasswordSafeConfigurableUi(private val settings: PasswordSafeSett
|
||||
KeePassFileManager(newDbFile, getDefaultMasterPasswordFile(), getEncryptionSpec(), secureRandom).useExisting()
|
||||
}
|
||||
catch (e: IncorrectMasterPasswordException) {
|
||||
throw ConfigurationException(IdeBundle.message("settings.password.master.password.for.keepass.database.is.not.correct"))
|
||||
throw ConfigurationException(CredentialStoreBundle.message("settings.password.master.password.for.keepass.database.is.not.correct"))
|
||||
}
|
||||
catch (e: Exception) {
|
||||
LOG.error(e)
|
||||
throw ConfigurationException(IdeBundle.message("settings.password.internal.error", e.message))
|
||||
throw ConfigurationException(CredentialStoreBundle.message("settings.password.internal.error", e.message ?: e.toString()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,22 +188,22 @@ internal class PasswordSafeConfigurableUi(private val settings: PasswordSafeSett
|
||||
|
||||
override fun getComponent(): JPanel {
|
||||
myPanel = panel {
|
||||
row { label(IdeBundle.message("passwordSafeConfigurable.save.password")) }
|
||||
row { label(CredentialStoreBundle.message("passwordSafeConfigurable.save.password")) }
|
||||
|
||||
buttonGroup(settings::providerType) {
|
||||
if (SystemInfo.isLinux || isMacOsCredentialStoreSupported) {
|
||||
row {
|
||||
radioButton(IdeBundle.message("passwordSafeConfigurable.in.native.keychain"), ProviderType.KEYCHAIN)
|
||||
radioButton(CredentialStoreBundle.message("passwordSafeConfigurable.in.native.keychain"), ProviderType.KEYCHAIN)
|
||||
}
|
||||
}
|
||||
|
||||
row {
|
||||
keepassRadioButton = radioButton(IdeBundle.message("passwordSafeConfigurable.in.keepass"), ProviderType.KEEPASS).component
|
||||
row(IdeBundle.message("settings.password.database")) {
|
||||
keepassRadioButton = radioButton(CredentialStoreBundle.message("passwordSafeConfigurable.in.keepass"), ProviderType.KEEPASS).component
|
||||
row(CredentialStoreBundle.message("settings.password.database")) {
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor().withFileFilter {
|
||||
it.isDirectory || it.name.endsWith(".kdbx")
|
||||
}
|
||||
keePassDbFile = textFieldWithBrowseButton(IdeBundle.message("passwordSafeConfigurable.keepass.database.file"),
|
||||
keePassDbFile = textFieldWithBrowseButton(CredentialStoreBundle.message("passwordSafeConfigurable.keepass.database.file"),
|
||||
fileChooserDescriptor = fileChooserDescriptor,
|
||||
fileChosen = {
|
||||
when {
|
||||
@@ -212,7 +212,7 @@ internal class PasswordSafeConfigurableUi(private val settings: PasswordSafeSett
|
||||
}
|
||||
})
|
||||
.apply {
|
||||
if (!SystemInfo.isWindows) comment(IdeBundle.message("passwordSafeConfigurable.weak.encryption"))
|
||||
if (!SystemInfo.isWindows) comment(CredentialStoreBundle.message("passwordSafeConfigurable.weak.encryption"))
|
||||
}.component
|
||||
gearButton(
|
||||
ClearKeePassDatabaseAction(),
|
||||
@@ -241,7 +241,7 @@ internal class PasswordSafeConfigurableUi(private val settings: PasswordSafeSett
|
||||
}
|
||||
}
|
||||
row {
|
||||
radioButton(IdeBundle.message("passwordSafeConfigurable.do.not.save"), ProviderType.MEMORY_ONLY)
|
||||
radioButton(CredentialStoreBundle.message("passwordSafeConfigurable.do.not.save"), ProviderType.MEMORY_ONLY)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,8 +249,8 @@ internal class PasswordSafeConfigurableUi(private val settings: PasswordSafeSett
|
||||
}
|
||||
|
||||
private fun usePgpKeyText(): String {
|
||||
val prefix = IdeBundle.message("passwordSafeConfigurable.protect.master.password.using.pgp.key")
|
||||
return if (pgpListModel.isEmpty) "$prefix ${IdeBundle.message("passwordSafeConfigurable.no.keys.configured")}" else "$prefix:"
|
||||
val prefix = CredentialStoreBundle.message("passwordSafeConfigurable.protect.master.password.using.pgp.key")
|
||||
return if (pgpListModel.isEmpty) "$prefix ${CredentialStoreBundle.message("passwordSafeConfigurable.no.keys.configured")}" else "$prefix:"
|
||||
}
|
||||
|
||||
private fun getSelectedPgpKey(): PgpKey? {
|
||||
@@ -274,9 +274,9 @@ internal class PasswordSafeConfigurableUi(private val settings: PasswordSafeSett
|
||||
|
||||
private inner class ClearKeePassDatabaseAction : DumbAwareAction("Clear") {
|
||||
override fun actionPerformed(event: AnActionEvent) {
|
||||
if (!MessageDialogBuilder.yesNo(IdeBundle.message("passwordSafeConfigurable.clear.passwords"),
|
||||
IdeBundle.message("passwordSafeConfigurable.are.you.sure")).yesText(
|
||||
IdeBundle.message("passwordSafeConfigurable.remove.passwords")).isYes) {
|
||||
if (!MessageDialogBuilder.yesNo(CredentialStoreBundle.message("passwordSafeConfigurable.clear.passwords"),
|
||||
CredentialStoreBundle.message("passwordSafeConfigurable.are.you.sure")).yesText(
|
||||
CredentialStoreBundle.message("passwordSafeConfigurable.remove.passwords")).isYes) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ internal class PasswordSafeConfigurableUi(private val settings: PasswordSafeSett
|
||||
|
||||
// even if current provider is not KEEPASS, all actions for db file must be applied immediately (show error if new master password not applicable for existing db file)
|
||||
if (createKeePassFileManager()?.askAndSetMasterKey(event) == true) {
|
||||
templatePresentation.text = IdeBundle.message("settings.password.change.master.password")
|
||||
templatePresentation.text = CredentialStoreBundle.message("settings.password.change.master.password")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1291,7 +1291,6 @@ configurable.font.name=Font
|
||||
configurable.notifications.name=Notifications
|
||||
configurable.quick.lists.name=Quick Lists
|
||||
|
||||
password.safe.configurable=Passwords
|
||||
http.proxy.configurable=HTTP Proxy
|
||||
consent.configurable=Data Sharing
|
||||
date.time.format.configurable=Date Formats
|
||||
@@ -1342,17 +1341,6 @@ configurable.TextMateConfigurableProvider.display.name=TextMate Bundles
|
||||
debug.tool.window.top.toolbar=Debug Tool Window Top Toolbar
|
||||
debug.tool.window.left.toolbar=Debug Tool Window Left Toolbar
|
||||
debug.watches.toolbar=Debug Watches Toolbar
|
||||
passwordSafeConfigurable.in.native.keychain=In native Keychain
|
||||
passwordSafeConfigurable.in.keepass=In KeePass
|
||||
passwordSafeConfigurable.keepass.database.file=KeePass Database File
|
||||
passwordSafeConfigurable.weak.encryption=Stored using weak encryption. It is recommended to store on encrypted volume for additional security.
|
||||
passwordSafeConfigurable.do.not.save=Do not save, forget passwords after restart
|
||||
passwordSafeConfigurable.protect.master.password.using.pgp.key=Protect master password using PGP key
|
||||
passwordSafeConfigurable.no.keys.configured=(No keys configured)
|
||||
passwordSafeConfigurable.clear.passwords=Clear Passwords
|
||||
passwordSafeConfigurable.are.you.sure=Are you sure want to remove all passwords?
|
||||
passwordSafeConfigurable.remove.passwords=Remove Passwords
|
||||
passwordSafeConfigurable.save.password=Save passwords:
|
||||
date.format.override.system.date.and.time.format=Override system date and time format
|
||||
date.format.date.format=Date format:
|
||||
date.format.date.patterns=Date patterns
|
||||
@@ -1419,16 +1407,9 @@ settings.menus.group.touch.bar=Touch Bar
|
||||
settings.general.default.directory=Default directory:
|
||||
settings.general.directory.preselected=This directory is preselected in "Open..." and "New | Project..." dialogs.
|
||||
settings.general.synchronization=Synchronization
|
||||
settings.password.database=Database:
|
||||
settings.password.internal.error.no.available.credential.store.implementation=Internal error, no available credential store implementation.
|
||||
settings.password.package.libsecret.1.0.is.not.installed=Package libsecret-1-0 is not installed (to install: sudo apt-get install libsecret-1-0 gnome-keyring).
|
||||
settings.password.unknown.provider.type=Unknown provider type: {0}
|
||||
settings.password.internal.error=Internal error: {0}
|
||||
settings.password.keepass.database.path.is.empty=KeePass database path is empty.
|
||||
settings.password.keepass.database.file.is.directory.=KeePass database file is directory.
|
||||
settings.password.keepass.database.file.should.ends.with.kdbx=KeePass database file should ends with ".kdbx".
|
||||
settings.password.master.password.for.keepass.database.is.not.correct=Master password for KeePass database is not correct ("Clear" can be used to reset database).
|
||||
settings.password.change.master.password=Change Master Password
|
||||
settings.file.color.column.scope=Scope
|
||||
settings.file.color.column.color=Color
|
||||
notification.type.no.popup=No popup
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
testServiceImplementation="com.intellij.ide.passwordSafe.impl.BasePasswordSafe"/>
|
||||
|
||||
<applicationConfigurable parentId="preferences.general" instance="com.intellij.credentialStore.PasswordSafeConfigurable"
|
||||
bundle="messages.IdeBundle"
|
||||
bundle="messages.CredentialStoreBundle"
|
||||
key="password.safe.configurable"
|
||||
id="application.passwordSafe"/>
|
||||
<applicationService serviceImplementation="com.intellij.execution.process.ColoredOutputTypeRegistry"/>
|
||||
|
||||
Reference in New Issue
Block a user