Skip to content

Commit

Permalink
Add zh-CN README
Browse files Browse the repository at this point in the history
  • Loading branch information
the1812 committed Nov 28, 2021
1 parent 989cf61 commit eefbccf
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# SteamCSS
Insert custom CSS to Steam Library and Browser.

[中文](README.zh-CN.md)

## Usage
Download `SteamCSS.zip` at [Releases](https://github.com/the1812/SteamCSS/releases) page.

There are 3 files:
There are 4 files:
- `SteamCSS.exe`: Main program
- `SteamPath.txt`: Specify Steam install path
- `StylePath.txt`: Specify Steam style files path
- `Style.css`: Your custom CSS code to insert

Write your Steam installation path in `SteamPath.txt` and custom CSS code in `Style.css`.

Start `SteamCSS.exe`, it will insert CSS code into Steam files and exit silently.
Start `SteamCSS.exe` to run the program.

## Notes
- The default `font-family` is from [Sarasa-Gothic](https://github.com/be5invis/Sarasa-Gothic).
Expand Down
22 changes: 22 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SteamCSS
向 Steam 库和内置浏览器插入自定义 CSS 代码.

[English](./README.md)

## 使用方式
[Releases](https://github.com/the1812/SteamCSS/releases) 页面下载 `SteamCSS.zip`.

解压后有 4 个文件:
- `SteamCSS.exe`: 主程序
- `SteamPath.txt`: 指定 Steam 安装文件夹
- `StylePath.txt`: 指定向哪些文件插入样式
- `Style.css`: 自定义要插入的 CSS 代码

先在 `SteamPath.txt` 里写下 Steam 的安装文件夹, `Style.css` 里写下要插入的 CSS 代码.

然后启动 `SteamCSS.exe` 就可以了.

## 注意事项
- 默认的 `font-family`[Sarasa-Gothic](https://github.com/be5invis/Sarasa-Gothic).
- 只对库和内置浏览器生效, 其他地方的 UI 字体可以用 [MacType](https://github.com/snowie2000/mactype) 替换.
- Steam 更新后可能会覆盖掉样式, 需要再运行一下这个工具重新写入.
24 changes: 23 additions & 1 deletion SteamCSS/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
Expand All @@ -8,8 +9,28 @@

namespace SteamCSS
{
enum TextKeys
{
NoFiles,
Processed,
}
class Program
{
static readonly Dictionary<string, Dictionary<TextKeys, string>> Texts = new Dictionary<string, Dictionary<TextKeys, string>>
{
{"zh-CN", new Dictionary<TextKeys, string>
{
{ TextKeys.NoFiles, "没有要处理的文件 (已跳过或未找到)" },
{ TextKeys.Processed, "已处理:" },
}
},
{"en-US", new Dictionary<TextKeys, string>
{
{ TextKeys.NoFiles, "No files to process. (Skipped or not found)" },
{ TextKeys.Processed, "Processed:" },
}
},
};
[STAThread]
static void Main()
{
Expand All @@ -34,7 +55,8 @@ static void Main()
}
});
var message = string.Join(Environment.NewLine, processedFiles);
MessageBox.Show(string.IsNullOrWhiteSpace(message) ? "没有要处理的文件" : $"已处理:{Environment.NewLine}{message}", "SteamCSS", MessageBoxButtons.OK, MessageBoxIcon.Information);
var texts = Texts.TryGetValue(CultureInfo.CurrentUICulture.Name, out var match) ? match : Texts["zh-CN"];
MessageBox.Show(string.IsNullOrWhiteSpace(message) ? texts[TextKeys.NoFiles] : $"{texts[TextKeys.Processed]}{Environment.NewLine}{message}", "SteamCSS", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (FileNotFoundException ex)
{
Expand Down

0 comments on commit eefbccf

Please sign in to comment.