Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions Snap2HTML/LanguageResources.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.IO;

namespace Snap2HTML
{
internal sealed class LanguageResources
{
private readonly Dictionary<string, string> values;

private LanguageResources(Dictionary<string, string> values)
{
this.values = values;
}

public static LanguageResources Load(string filePath)
{
var values = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

if (File.Exists(filePath))
{
foreach (var rawLine in File.ReadAllLines(filePath))
{
var line = rawLine.Trim();
if (line.Length == 0 || line.StartsWith("#", StringComparison.Ordinal))
{
continue;
}

var index = line.IndexOf('=');
if (index <= 0)
{
continue;
}

var key = line.Substring(0, index).Trim();
var value = line.Substring(index + 1).Trim();
if (key.Length == 0)
{
continue;
}

values[key] = value;
}
}

return new LanguageResources(values);
}

public string Get(string key, string fallback)
{
if (values.TryGetValue(key, out var value) && !string.IsNullOrEmpty(value))
{
return value;
}

return fallback;
}
}
}
27 changes: 27 additions & 0 deletions Snap2HTML/Languages/en.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# English UI strings
TabSnapshot=Snapshot
TabCustomDesign=Custom Design
TabLanguage=Language
TabAbout=About
LanguageLabel=Language:
RootFolder=Root folder:
IncludeHidden=Include hidden items
IncludeSystem=Include system items
PageTitle=Page title:
LinkFiles=Link files:
Enable=Enable
CreateSnapshot= Create Snapshot
OpenInBrowser=Open in browser when ready
StatusSelectRoot=Select a root folder to begin...
SelectRootFolder=Select the root folder to create a snapshot from:
CustomDesignIntro=Did you know that it is possible to change the appearance of the generated html file? For example you might want to change the logo and colors to match your company's.
CustomDesignTemplate=If you know some html/css you can modify the template yourself to better suit your needs:
CustomDesignContact=You are also welcome to contact me and I can help you for a small compensation:
OpenTemplate=Open template.html in notepad
OpenContact=Open contact page
MoreUtilities=More utilities by me
AboutSoftware=Free Software by RL Vision
ExifDescription=Delete all metadata before publishing images to protect your privacy.
FlashRenDescription=Advanced file renaming utility that will save you lots of time.
MoreInfo=More info
SnapshotTitleFormat=Snapshot of {0}
27 changes: 27 additions & 0 deletions Snap2HTML/Languages/es.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Español UI strings
TabSnapshot=Captura
TabCustomDesign=Diseño Personalizado
TabLanguage=Idioma
TabAbout=Acerca de
LanguageLabel=Idioma:
RootFolder=Carpeta raíz:
IncludeHidden=Incluir elementos ocultos
IncludeSystem=Incluir elementos del sistema
PageTitle=Título de página:
LinkFiles=Archivos de enlace:
Enable=Habilitar
CreateSnapshot= Crear Captura
OpenInBrowser=Abrir en navegador al terminar
StatusSelectRoot=Seleccione una carpeta raíz para comenzar...
SelectRootFolder=Seleccione la carpeta raíz para crear una captura:
CustomDesignIntro=¿Sabía que es posible cambiar la apariencia del archivo HTML generado? Por ejemplo, es posible que desee cambiar el logotipo y los colores para adaptarlos a los de su empresa.
CustomDesignTemplate=Si conoces algo de html/css puedes modificar la plantilla tú mismo para que se adapte mejor a tus necesidades:
CustomDesignContact=También puedes contactarme y puedo ayudarte a cambio de una pequeña compensación:
OpenTemplate=Abrir template.html en el bloc de notas
OpenContact=Abrir página de contacto
MoreUtilities=Más utilidades mías
AboutSoftware=Software libre de RL Vision
ExifDescription=Elimine todos los metadatos antes de publicar imágenes para proteger su privacidad.
FlashRenDescription=Utilidad avanzada de cambio de nombre de archivos que le ahorrará mucho tiempo.
MoreInfo=Más información
SnapshotTitleFormat=Captura de {0}
27 changes: 27 additions & 0 deletions Snap2HTML/Languages/zh.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 中文 UI strings
TabSnapshot=快照
TabCustomDesign=自定义设计
TabLanguage=语言
TabAbout=关于
LanguageLabel=语言:
RootFolder=根目录:
IncludeHidden=包含隐藏项
IncludeSystem=包含系统项
PageTitle=页面标题:
LinkFiles=链接文件:
Enable=启用
CreateSnapshot= 创建快照
OpenInBrowser=完成后在浏览器中打开
StatusSelectRoot=选择一个根目录开始...
SelectRootFolder=请选择根目录以创建快照:
CustomDesignIntro=您知道可以更改生成的HTML文件的外观吗?例如,您可能希望更改徽标和颜色以匹配您公司的风格。
CustomDesignTemplate=如果您了解一些HTML/CSS,您可以自己修改模板以更好地满足您的需求:
CustomDesignContact=您也可以联系我,我可以提供少许帮助:
OpenTemplate=在记事本中打开 template.html
OpenContact=打开联系页面
MoreUtilities=更多我的实用工具
AboutSoftware=RL Vision的免费软件
ExifDescription=发布图像之前删除所有元数据,以保护您的隐私。
FlashRenDescription=高级文件重命名实用工具,可以为您节省大量时间。
MoreInfo=更多信息
SnapshotTitleFormat={0} 的快照
13 changes: 13 additions & 0 deletions Snap2HTML/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Snap2HTML/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
<Setting Name="txtTitle" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Language" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">en</Value>
</Setting>
</Settings>
</SettingsFile>
4 changes: 4 additions & 0 deletions Snap2HTML/Snap2HTML.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="Helpers\HighDpiHelper.cs" />
<Compile Include="LanguageResources.cs" />
<Compile Include="Models.cs" />
<Compile Include="Utils.cs" />
<Compile Include="Helpers\PortableSettingsProvider.cs" />
Expand All @@ -116,6 +117,9 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Languages\en.lang" />
<None Include="Languages\es.lang" />
<None Include="Languages\zh.lang" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down
43 changes: 42 additions & 1 deletion Snap2HTML/frmMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading