Skip to content

Commit 58760cd

Browse files
committed
updated localization
1 parent 7b57f4f commit 58760cd

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

resources/messages/messages.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,9 @@ ParticleEmitterInfluencerGeometryList=Geometry list(not saved)
269269
ParticleEmitterInfluencerGeometry=Geometry
270270
271271
MaterialModelPropertyControlNoMaterial=No material
272-
273272
AbstractElementPropertyControlNoElement=No element
274-
275273
LayerPropertyControlNoLayer=No layer
274+
AudioKeyPropertyControlNoAudio=No audio
276275
277276
RenameDialogTitle=Rename
278277
RenameDialogNewNameLabel=New name

resources/messages/messages_ru.properties

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,10 @@ ParticleEmitterInfluencerInterpolation=Интерп.
268268
ParticleEmitterInfluencerGeometryList=Список геометрий(не сохр.)
269269
ParticleEmitterInfluencerGeometry=Геометрия
270270
271-
MaterialModelPropertyControlNoMaterial=Материал отсутствует
272-
273-
AbstractElementPropertyControlNoElement=Элемент отсутствует
274-
271+
MaterialModelPropertyControlNoMaterial=Нет материала
272+
AbstractElementPropertyControlNoElement=Нет элемента
275273
LayerPropertyControlNoLayer=Нет слоя
274+
AudioKeyPropertyControlNoAudio=Нет аудио
276275
277276
RenameDialogTitle=Переименовать
278277
RenameDialogNewNameLabel=Новое имя

src/com/ss/editor/Messages.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,9 @@ public class Messages {
286286
public static final String PARTICLE_EMITTER_INFLUENCER_GEOMETRY;
287287

288288
public static final String MATERIAL_MODEL_PROPERTY_CONTROL_NO_MATERIAL;
289-
290289
public static final String ABSTRACT_ELEMENT_PROPERTY_CONTROL_NO_ELEMENT;
291-
292-
public static final String LAYER_PROPERTY_CONTROL_NO_LAYERT;
290+
public static final String LAYER_PROPERTY_CONTROL_NO_LAYER;
291+
public static final String AUDIO_KEY_PROPERTY_CONTROL_NO_AUDIO;
293292

294293
public static final String RENAME_DIALOG_TITLE;
295294
public static final String RENAME_DIALOG_NEW_NAME_LABEL;
@@ -682,10 +681,9 @@ public class Messages {
682681
PARTICLE_EMITTER_INFLUENCER_GEOMETRY = bundle.getString("ParticleEmitterInfluencerGeometry");
683682

684683
MATERIAL_MODEL_PROPERTY_CONTROL_NO_MATERIAL = bundle.getString("MaterialModelPropertyControlNoMaterial");
685-
686684
ABSTRACT_ELEMENT_PROPERTY_CONTROL_NO_ELEMENT = bundle.getString("AbstractElementPropertyControlNoElement");
687-
688-
LAYER_PROPERTY_CONTROL_NO_LAYERT = bundle.getString("LayerPropertyControlNoLayer");
685+
LAYER_PROPERTY_CONTROL_NO_LAYER = bundle.getString("LayerPropertyControlNoLayer");
686+
AUDIO_KEY_PROPERTY_CONTROL_NO_AUDIO = bundle.getString("AudioKeyPropertyControlNoAudio");
689687

690688
RENAME_DIALOG_TITLE = bundle.getString("RenameDialogTitle");
691689
RENAME_DIALOG_NEW_NAME_LABEL = bundle.getString("RenameDialogNewNameLabel");

src/com/ss/editor/ui/control/model/property/control/AudioKeyModelPropertyEditor.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
import com.ss.editor.Editor;
1111
import com.ss.editor.FileExtensions;
1212
import com.ss.editor.JFXApplication;
13+
import com.ss.editor.Messages;
1314
import com.ss.editor.model.undo.editor.ModelChangeConsumer;
1415
import com.ss.editor.ui.Icons;
16+
import com.ss.editor.ui.component.asset.tree.context.menu.action.DeleteFileAction;
17+
import com.ss.editor.ui.component.asset.tree.context.menu.action.NewFileAction;
18+
import com.ss.editor.ui.component.asset.tree.context.menu.action.RenameFileAction;
1519
import com.ss.editor.ui.css.CSSClasses;
1620
import com.ss.editor.ui.css.CSSIds;
1721
import com.ss.editor.ui.dialog.asset.AssetEditorDialog;
@@ -27,6 +31,7 @@
2731
import java.nio.file.Path;
2832
import java.nio.file.Paths;
2933
import java.util.Objects;
34+
import java.util.function.Predicate;
3035

3136
import javafx.geometry.Insets;
3237
import javafx.scene.control.Button;
@@ -45,7 +50,11 @@
4550
*/
4651
public class AudioKeyModelPropertyEditor extends ModelPropertyControl<AudioNode, AudioKey> {
4752

48-
public static final String NO_AUDIO = "No audio";
53+
private static final Predicate<Class<?>> ACTION_TESTER = type -> type == NewFileAction.class ||
54+
type == DeleteFileAction.class ||
55+
type == RenameFileAction.class;
56+
57+
public static final String NO_AUDIO = Messages.AUDIO_KEY_PROPERTY_CONTROL_NO_AUDIO;
4958
public static final Insets BUTTON_OFFSET = new Insets(0, 0, 0, 3);
5059

5160
protected static final FXEventManager FX_EVENT_MANAGER = FXEventManager.getInstance();
@@ -116,6 +125,7 @@ protected void processChange() {
116125

117126
final AssetEditorDialog dialog = new FileAssetEditorDialog(this::addAudioData);
118127
dialog.setExtensionFilter(AUDIO_EXTENSIONS);
128+
dialog.setActionTester(ACTION_TESTER);
119129
dialog.show(scene.getWindow());
120130
}
121131

src/com/ss/editor/ui/control/model/property/control/LayerModelPropertyControl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private class LayerCell extends ListCell<SceneLayer> {
3737
protected void updateItem(@Nullable final SceneLayer layer, final boolean empty) {
3838
super.updateItem(layer, empty);
3939
if (layer == null) return;
40-
setText(layer == SceneLayer.NO_LAYER ? Messages.LAYER_PROPERTY_CONTROL_NO_LAYERT : layer.getName());
40+
setText(layer == SceneLayer.NO_LAYER ? Messages.LAYER_PROPERTY_CONTROL_NO_LAYER : layer.getName());
4141
}
4242
}
4343

0 commit comments

Comments
 (0)