Moves some modules and files, adds save subtitles
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* Combines multiple resource bundles
|
||||
*/
|
||||
public class CombinedResourceBundle extends ResourceBundle {
|
||||
|
||||
private final Map<String, String> resources;
|
||||
|
||||
public CombinedResourceBundle(final ResourceBundle... bundles) {
|
||||
this(Arrays.asList(bundles));
|
||||
}
|
||||
|
||||
public CombinedResourceBundle(final Iterable<ResourceBundle> bundles) {
|
||||
this.resources = new HashMap<>();
|
||||
bundles.forEach(rb -> rb.getKeys().asIterator().forEachRemaining(key -> resources.put(key, rb.getString(key))));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object handleGetObject(final String key) {
|
||||
return resources.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getKeys() {
|
||||
return Collections.enumeration(resources.keySet());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
|
||||
import java.util.spi.ResourceBundleProvider;
|
||||
|
||||
/**
|
||||
* Provider for MainBundle
|
||||
*/
|
||||
public interface MainBundleProvider extends ResourceBundleProvider {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
|
||||
import java.util.spi.AbstractResourceBundleProvider;
|
||||
|
||||
/**
|
||||
* Implementation of {@link MainBundleProvider}
|
||||
*/
|
||||
public class MainBundleProviderImpl extends AbstractResourceBundleProvider implements MainBundleProvider {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
|
||||
import java.util.spi.ResourceBundleProvider;
|
||||
|
||||
/**
|
||||
* Provider for ParametersBundle
|
||||
*/
|
||||
public interface ParametersBundleProvider extends ResourceBundleProvider {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
|
||||
import java.util.spi.AbstractResourceBundleProvider;
|
||||
|
||||
/**
|
||||
* Implementation of {@link ParametersBundleProvider}
|
||||
*/
|
||||
public class ParametersBundleProviderImpl extends AbstractResourceBundleProvider implements ParametersBundleProvider {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
|
||||
import java.util.spi.ResourceBundleProvider;
|
||||
|
||||
/**
|
||||
* Provider for SetupBundle
|
||||
*/
|
||||
public interface SetupBundleProvider extends ResourceBundleProvider {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
|
||||
import java.util.spi.AbstractResourceBundleProvider;
|
||||
|
||||
/**
|
||||
* Implementation of {@link SetupBundleProvider}
|
||||
*/
|
||||
public class SetupBundleProviderImpl extends AbstractResourceBundleProvider implements SetupBundleProvider {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
|
||||
import java.util.spi.ResourceBundleProvider;
|
||||
|
||||
/**
|
||||
* Provider for WorkBundle
|
||||
*/
|
||||
public interface WorkBundleProvider extends ResourceBundleProvider {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
|
||||
import java.util.spi.AbstractResourceBundleProvider;
|
||||
|
||||
/**
|
||||
* Implementation of {@link WorkBundleProviderImpl}
|
||||
*/
|
||||
public class WorkBundleProviderImpl extends AbstractResourceBundleProvider implements WorkBundleProvider {
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.github.gtache.autosubtitle.modules.gui.impl;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
|
||||
public @interface FontFamily {
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.github.gtache.autosubtitle.modules.gui.impl;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
|
||||
public @interface FontSize {
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.github.gtache.autosubtitle.modules.gui.impl;
|
||||
|
||||
import com.github.gtache.autosubtitle.gui.impl.CombinedResourceBundle;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* Dagger module for GUI
|
||||
*/
|
||||
@Module
|
||||
public class GuiCoreModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
static ResourceBundle providesBundle() {
|
||||
return new CombinedResourceBundle(ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.MainBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.SetupBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.WorkBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.ParametersBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.MediaBundle"));
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@Play
|
||||
static byte[] providesPlayImage() {
|
||||
try (final var in = GuiCoreModule.class.getResourceAsStream("/com/github/gtache/autosubtitle/gui/impl/play_64.png")) {
|
||||
return in.readAllBytes();
|
||||
} catch (final IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@Pause
|
||||
static byte[] providesPauseImage() {
|
||||
try (final var in = GuiCoreModule.class.getResourceAsStream("/com/github/gtache/autosubtitle/gui/impl/pause_64.png")) {
|
||||
return in.readAllBytes();
|
||||
} catch (final IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@FontFamily
|
||||
static String providesFontFamily() {
|
||||
return "Arial";
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@FontSize
|
||||
static int providesFontSize() {
|
||||
return 12;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.github.gtache.autosubtitle.modules.gui.impl;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
|
||||
public @interface Pause {
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.github.gtache.autosubtitle.modules.gui.impl;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Qualifier
|
||||
@Documented
|
||||
@Retention(RUNTIME)
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
|
||||
public @interface Play {
|
||||
}
|
||||
24
gui/core/src/main/java/module-info.java
Normal file
24
gui/core/src/main/java/module-info.java
Normal file
@@ -0,0 +1,24 @@
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.MainBundleProvider;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.MainBundleProviderImpl;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.ParametersBundleProvider;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.ParametersBundleProviderImpl;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.SetupBundleProvider;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.SetupBundleProviderImpl;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.WorkBundleProvider;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.WorkBundleProviderImpl;
|
||||
|
||||
/**
|
||||
* Core gui module for autosubtitle
|
||||
*/
|
||||
module com.github.gtache.autosubtitle.gui.core {
|
||||
requires transitive com.github.gtache.autosubtitle.gui.api;
|
||||
requires transitive com.github.gtache.autosubtitle.core;
|
||||
exports com.github.gtache.autosubtitle.gui.impl;
|
||||
exports com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
exports com.github.gtache.autosubtitle.modules.gui.impl;
|
||||
|
||||
provides MainBundleProvider with MainBundleProviderImpl;
|
||||
provides ParametersBundleProvider with ParametersBundleProviderImpl;
|
||||
provides SetupBundleProvider with SetupBundleProviderImpl;
|
||||
provides WorkBundleProvider with WorkBundleProviderImpl;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
main.tab.parameters.label=Parameters
|
||||
main.tab.setup.label=Setup
|
||||
main.tab.work.label=Work
|
||||
@@ -0,0 +1,3 @@
|
||||
main.tab.parameters.label=Param\u00E8tres
|
||||
main.tab.setup.label=Installation
|
||||
main.tab.work.label=Travail
|
||||
@@ -0,0 +1 @@
|
||||
media.volume.label=Volume
|
||||
@@ -0,0 +1 @@
|
||||
media.volume.label=Volume
|
||||
@@ -0,0 +1,6 @@
|
||||
parameters.button.reset.label=Reset
|
||||
parameters.button.save.label=Save
|
||||
parameters.extraction.model.label=Model to use for subtitle extraction
|
||||
parameters.subtitles.font.family=Default subtitle font name
|
||||
parameters.subtitles.font.size=Default subtitle font size
|
||||
parameters.subtitles.output.format=Output format for the subtitles
|
||||
@@ -0,0 +1,6 @@
|
||||
parameters.button.reset.label=R\u00E9initialiser
|
||||
parameters.button.save.label=Sauvegarder
|
||||
parameters.extraction.model.label=Mod\u00E8le utilis\u00E9 pour l'extraction des sous-titres
|
||||
parameters.subtitles.font.family=Police par d\u00E9faut pour les sous-titres
|
||||
parameters.subtitles.font.size=Taille de la police par d\u00E9faut pour les sous-titres
|
||||
parameters.subtitles.output.format=Format de sortie pour les sous-titres
|
||||
@@ -0,0 +1,32 @@
|
||||
setup.description.label=Status of the various tools used by the app
|
||||
setup.event.check.end.label=Checked {0}
|
||||
setup.event.check.start.label=Checking {0}
|
||||
setup.event.delete.end.label=Deleted {0}
|
||||
setup.event.delete.start.label=Deleting {0}
|
||||
setup.event.download.end.label=Downloaded {0}
|
||||
setup.event.download.start.label=Downloading {0}
|
||||
setup.event.install.end.label=Installed {0}
|
||||
setup.event.install.start.label=Installing {0}
|
||||
setup.event.uninstall.end.label=Uninstalled {0}
|
||||
setup.event.uninstall.start.label=Uninstalling {0}
|
||||
setup.event.update.end.label=Updated {0}
|
||||
setup.event.update.start.label=Updating {0}
|
||||
setup.install.error.label=An error occurred while installing : {0}
|
||||
setup.install.error.title=Error installing
|
||||
setup.menu.install.label=Install
|
||||
setup.menu.label=Action
|
||||
setup.menu.reinstall.label=Reinstall
|
||||
setup.menu.uninstall.label=Uninstall
|
||||
setup.menu.update.label=Update
|
||||
setup.reinstall.error.label=An error occurred while reinstalling : {0}
|
||||
setup.reinstall.error.title=Error reinstalling
|
||||
setup.status.bundle_installed.label=is installed.
|
||||
setup.status.errored.label=threw an error.
|
||||
setup.status.installed.label=is installed.
|
||||
setup.status.not_installed.label=is not installed.
|
||||
setup.status.system_installed.label=is installed (system).
|
||||
setup.status.update_available.label=has an available update.
|
||||
setup.uninstall.error.label=An error occurred while uninstalling : {0}
|
||||
setup.uninstall.error.title=Error uninstalling
|
||||
setup.update.error.label=An error occurred while updating : {0}
|
||||
setup.update.error.title=Error updating
|
||||
@@ -0,0 +1,32 @@
|
||||
setup.description.label=Statut des outils utilis\u00E9s par l'application
|
||||
setup.event.check.end.label=Contr\u00F4le de {0} termin\u00E9
|
||||
setup.event.check.start.label=Contr\u00F4le de {0} en cours
|
||||
setup.event.delete.end.label=Suppression de {0} termin\u00E9e
|
||||
setup.event.delete.start.label=Suppression de {0} en cours
|
||||
setup.event.download.end.label=T\u00E9l\u00E9chargement de {0} termin\u00E9
|
||||
setup.event.download.start.label=T\u00E9l\u00E9chargement de {0} en cours
|
||||
setup.event.install.end.label=Installation de {0} termin\u00E9e
|
||||
setup.event.install.start.label=Installation de {0} en cours
|
||||
setup.event.uninstall.end.label=D\u00E9sinstallation de {0} termin\u00E9e
|
||||
setup.event.uninstall.start.label=D\u00E9sinstallation de {0} en cours
|
||||
setup.event.update.end.label=Mise \u00E0 jour de {0} termin\u00E9e
|
||||
setup.event.update.start.label=Mise \u00E0 jour de {0} en cours
|
||||
setup.install.error.label=Une erreur s''est produite lors de l''installation: {0}
|
||||
setup.install.error.title=Erreur d'installation
|
||||
setup.menu.install.label=Installer
|
||||
setup.menu.label=Action
|
||||
setup.menu.reinstall.label=R\u00E9installer
|
||||
setup.menu.uninstall.label=D\u00E9sinstaller
|
||||
setup.menu.update.label=Mettre \u00E0 jour
|
||||
setup.reinstall.error.label=Une erreur s''est produite lors de la r\u00E9installation: {0}
|
||||
setup.reinstall.error.title=Erreur de r\u00E9installation
|
||||
setup.status.bundle_installed.label=est install\u00E9.
|
||||
setup.status.errored.label=a caus\u00E9 une erreur.
|
||||
setup.status.installed.label=est install\u00E9.
|
||||
setup.status.not_installed.label=n'est pas install\u00E9.
|
||||
setup.status.system_installed.label=est install\u00E9 (syst\u00E8me).
|
||||
setup.status.update_available.label=a une mise \u00E0 jour disponible.
|
||||
setup.uninstall.error.label=Une erreur s''est produite lors de la d\u00E9sinstallation : {0}
|
||||
setup.uninstall.error.title=Erreur de d\u00E9sinstallation
|
||||
setup.update.error.label=Une erreur s''est produite lors de la mise \u00E0 jour : {0}
|
||||
setup.update.error.title=Erreur de mise \u00E0 jour
|
||||
@@ -0,0 +1,30 @@
|
||||
work.button.export.hard.label=Burn video...
|
||||
work.button.export.hard.tooltip=Burns the subtitles into the video. This means that the subtitles are printed in the image and can't be disabled.
|
||||
work.button.export.soft.label=Export video...
|
||||
work.button.export.soft.tooltip=Adds the subtitles to the video. This allows a video to have multiple subtitles and to enable them at will.
|
||||
work.button.extract.label=Extract subtitles
|
||||
work.button.file.label=Open video...
|
||||
work.button.load.label=Load subtitles...
|
||||
work.button.reset.label=Reset subtitles
|
||||
work.button.subtitles.save.label=Save subtitles...
|
||||
work.export.error.label=Error during the export : {0}
|
||||
work.export.error.title=Error exporting
|
||||
work.extract.error.label=Error extracting subtitles : {0}
|
||||
work.extract.error.title=Error extracting
|
||||
work.language.label=Video language
|
||||
work.load.subtitles.error.label=Error loading subtitles : {0}
|
||||
work.load.subtitles.error.title=Error loading
|
||||
work.load.video.error.label=Error loading video : {0}
|
||||
work.load.video.error.title=Error loading
|
||||
work.save.subtitles.error.label=Error saving subtitles : {0}
|
||||
work.save.subtitles.error.title=Error saving
|
||||
work.save.subtitles.missing.converter.label=No converter found for {0}
|
||||
work.save.subtitles.missing.converter.title=No converter found
|
||||
work.status.exporting.label=Exporting...
|
||||
work.status.extracting.label=Extracting...
|
||||
work.status.idle.label=Idle
|
||||
work.status.translating.label=Translating...
|
||||
work.table.column.from.label=From
|
||||
work.table.column.text.label=Text
|
||||
work.table.column.to.label=To
|
||||
work.translate.label=Automatic translations
|
||||
@@ -0,0 +1,28 @@
|
||||
work.button.export.hard.label=Graver la vid\u00E9o...
|
||||
work.button.export.hard.tooltip=Grave les sous-titres dans la vid\u00E9o. Cela veut dire que les sous-titres sont \u00E9crits directement dans l'image et ne peuvent pas \u00EAtre d\u00E9sactiv\u00E9s.
|
||||
work.button.export.soft.label=Exporter la vid\u00E9o...
|
||||
work.button.export.soft.tooltip=Ajoute les sous-titres \u00E0 la vid\u00E9o. Cela permet d'avoir plusieurs pistes de sous-titres dans une m\u00EAme vid\u00E9o et de les activer comme d\u00E9sir\u00E9.
|
||||
work.button.extract.label=Extraire les sous-titres
|
||||
work.button.file.label=Ouvrir une vid\u00E9o...
|
||||
work.button.load.label=Charger des sous-titres...
|
||||
work.button.reset.label=R\u00E9initialiser les sous-titres
|
||||
work.button.subtitles.save.label=Sauvegarder les sous-titres...
|
||||
work.export.error.label=Erreur durant l''export : {0}
|
||||
work.export.error.title=Erreur d'export
|
||||
work.extract.error.label=Erreur durant l''extraction des sous-titres : {0}
|
||||
work.extract.error.title=Erreur d'extraction
|
||||
work.language.label=Language de la vid\u00E9o
|
||||
work.load.subtitles.error.label=Erreur de chargement des sous-titres : {0}
|
||||
work.load.subtitles.error.title=Erreur de chargement
|
||||
work.load.video.error.label=Erreur lors du chargement de la vid\u00E9o : {0}
|
||||
work.load.video.error.title=Erreur de chargement
|
||||
work.save.subtitles.missing.converter.label=Aucun convertisseur trouv\u00E9 pour {0}
|
||||
work.save.subtitles.missing.converter.title=Aucun convertisseur trouv\u00E9
|
||||
work.status.exporting.label=Exportation en cours...
|
||||
work.status.extracting.label=Extraction en cours...
|
||||
work.status.idle.label=Idle
|
||||
work.status.translating.label=Traduction en cours...
|
||||
work.table.column.from.label=De
|
||||
work.table.column.text.label=Texte
|
||||
work.table.column.to.label=\u00C0
|
||||
work.translate.label=Traductions automatiques
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Reference in New Issue
Block a user