Skip to content

Commit

Permalink
translate all messages and labels to english
Browse files Browse the repository at this point in the history
  • Loading branch information
seramo committed Sep 23, 2024
1 parent cf230ad commit 42b3ab4
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 70 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ A web-based tool to generate V2Ray configurations for multiple IP addresses or r

## Description

The **V2Ray Config Modifier** is an HTML and JavaScript-based application designed to help users generate multiple V2Ray configurations efficiently. Users can enter an existing VLESS or VMESS configuration, specify an IP address or range, or choose from predefined IP ranges of popular CDN providers like Cloudflare, G-Core, and Fastly. The tool then generates new configurations for each IP address in the specified range.
The **V2Ray Config Modifier** is an HTML and JavaScript-based application designed to help users generate multiple V2Ray configurations efficiently. Users can enter an existing VLESS or VMESS configuration, specify an IP address or range, or choose from predefined IP ranges of popular CDN providers like Cloudflare, Gcore, and Fastly. The tool then generates new configurations for each IP address in the specified range.

## Features

- **VLESS and VMESS Support**: Accepts both VLESS and VMESS configurations as input.
- **IP Range Input**: Users can enter custom IP addresses or ranges.
- **Predefined IP Ranges**: Easily select from existing IP ranges of Cloudflare, G-Core, or Fastly.
- **Predefined IP Ranges**: Easily select from existing IP ranges of Cloudflare, Gcore, or Fastly.
- **Bulk Config Generation**: Generates configurations for all specified IP addresses with a single click.
- **User-Friendly Interface**: Simple and intuitive design requiring no installation.
- **Export Options**: Save all generated configurations to a file.
Expand Down Expand Up @@ -64,7 +64,7 @@ This web-based version is fully functional and allows you to generate and downlo
#### Option B: Use Predefined IP Ranges

- **Cloudflare IP Ranges**: Select to use Cloudflare's IP addresses.
- **G-Core IP Ranges**: Choose G-Core's IP addresses.
- **Gcore IP Ranges**: Choose Gcore's IP addresses.
- **Fastly IP Ranges**: Opt for Fastly's IP addresses.
### Step 3: Generate Configurations
Expand Down
26 changes: 13 additions & 13 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ function generateConfigs() {
const inputConfig = document.getElementById('inputConfig').value;

if (!inputConfig) {
showWarning('لطفا کانفیگ را وارد کنید.');
showWarning('Please enter the config.');
return;
}

if (!isValidConfigFormat(inputConfig)) {
showWarning('کانفیگ وارد شده معتبر نیست.');
showWarning('The entered config is invalid.');
return;
}

Expand All @@ -132,13 +132,13 @@ function modifyConfigsFromCIDR() {
const outputCount = document.getElementById('outputCount').value;

if (ipRanges.length === 0) {
showWarning('لطفا حداقل یک رنج آی پی را وارد کنید.');
showWarning('Please enter at least one IP range.');
return;
}

for (const ipRange of ipRanges) {
if (!isValidCIDR(ipRange.trim())) {
showWarning(`لطفا یک رنج آی پی معتبر وارد کنید: ${ipRange}`);
showWarning(`Please enter a valid IP range: ${ipRange}`);
return;
}
}
Expand Down Expand Up @@ -171,7 +171,7 @@ function modifyConfigsFromList() {
const ipList = document.getElementById('ipList').value.trim().split('\n').filter(ip => ip.trim() !== '');

if (ipList.length === 0) {
showWarning('لطفا لیست آی پی‌ را وارد کنید.');
showWarning('Please enter the IP list.');
return;
}

Expand All @@ -182,7 +182,7 @@ function modifyConfigsFromList() {
if (ipaddr.isValid(ipStr)) {
generatedOutput += replaceIPInConfig(inputConfig, ipaddr.parse(ipStr));
} else {
showWarning(`آی پی نامعتبر یافت شد: ${ipStr}`);
showWarning(`Invalid IP found: ${ipStr}`);
return;
}
}
Expand Down Expand Up @@ -214,11 +214,11 @@ function displayResult(count) {
const downloadButton = document.getElementById('downloadButton');

if (generatedOutput) {
showSuccess(`تولید ${count} کانفیگ با موفقیت انجام شد.`);
showSuccess(`Successfully generated ${count} configs.`);
copyButton.style.display = 'inline-block';
downloadButton.style.display = 'inline-block';
} else {
showError('هیچ کانفیگی تولید نشد.');
showError('No configs were generated.');
copyButton.style.display = 'none';
downloadButton.style.display = 'none';
}
Expand All @@ -230,14 +230,14 @@ async function loadIPRanges(service) {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`خطا در دریافت داده‌ها: ${response.statusText}`);
throw new Error(`Error retrieving data: ${response.statusText}`);
}

const data = await response.json();
const ipRanges = data.ipv4 || [];

if (ipRanges.length === 0) {
showWarning('رنج آی پی موردنظر یافت نشد.');
showWarning('No IP range found.');
return;
}

Expand All @@ -249,17 +249,17 @@ async function loadIPRanges(service) {
}
} catch (error) {
console.error(error);
showError('خطایی در بارگیری آی‌پی‌ها رخ داد.');
showError('An error occurred while loading IPs.');
}
}

function copyToClipboard() {
if (generatedOutput) {
navigator.clipboard.writeText(generatedOutput.replace(/\n\n/g, '\n').trimEnd()).then(() => {
showSuccess('کانفیگ‌ها در کلیپ‌بورد ذخیره شدند.');
showSuccess('Configs have been saved to clipboard.');
}).catch(err => {
console.error(err);
showError('خطا در کپی: ' + err);
showError('Copy error: ' + err);
});
}
}
Expand Down
108 changes: 54 additions & 54 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>اصلاح کانفیگ‌های V2Ray</title>
<meta name="description" content="ابزاری برای اصلاح کانفیگ‌های V2Ray">
<title>V2Ray Config Modifier</title>
<meta name="description" content="A tool for modifying V2Ray configs">
<meta name="theme-color" content="#0d6efd">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;700&display=swap" rel="stylesheet">
<link href="assets/css/style.css?v=1.0.0" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand me-0" href="https://seramo.github.io/v2ray-config-modifier/">اصلاح کانفیگ</a>
<ul class="navbar-nav px-0">
<li class="nav-item">
<a class="nav-link" href="https://youtu.be/J9g1kbdW8Oc/" target="_blank">آموزش</a>
</li>
<li class="nav-item">
<a class="nav-link ps-0" href="https://github.com/seramo/v2ray-config-modifier/" target="_blank">گیت‌هاب</a>
</li>
</ul>
</div>
</nav>
<div class="container mt-5">
<div class="row">
<div class="col-12">
<div class="alert" role="alert" id="messageBox" style="display: none;">
<span id="messageText"></span>
</div>
<nav class="navbar navbar-expand navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand me-0" href="https://seramo.github.io/v2ray-config-modifier/">V2Ray Config Modifier</a>
<ul class="navbar-nav px-0">
<li class="nav-item">
<a class="nav-link" href="https://youtu.be/J9g1kbdW8Oc/" target="_blank">Tutorial</a>
</li>
<li class="nav-item">
<a class="nav-link ps-0" href="https://github.com/seramo/v2ray-config-modifier/" target="_blank">GitHub</a>
</li>
</ul>
</div>
</nav>
<div class="container mt-5">
<div class="row">
<div class="col-12">
<div class="alert" role="alert" id="messageBox" style="display: none;">
<span id="messageText"></span>
</div>
</div>

<div class="col-12">
<label for="inputConfig" class="form-label">کانفیگ</label>
<input type="text" id="inputConfig" class="form-control" placeholder="vless یا vmess" dir="ltr">
</div>
<div class="col-12">
<label for="inputConfig" class="form-label">Config</label>
<input type="text" id="inputConfig" class="form-control" placeholder="vless or vmess" dir="ltr">
</div>

<div class="col-12 mt-3">
<label for="inputType" class="form-label">نوع ورودی</label>
<select id="inputType" class="form-control" onchange="toggleInputFields()">
<option value="cidr">رنج آی پی</option>
<option value="list">لیست آی پی</option>
</select>
</div>
<div class="col-12 mt-3">
<label for="inputType" class="form-label">Input Type</label>
<select id="inputType" class="form-control" onchange="toggleInputFields()">
<option value="cidr">IP Ranges</option>
<option value="list">IP List</option>
</select>
</div>

<div class="col-12 mt-3" id="cidrFields">
<label for="ipRange" class="form-label">رنج آی پی (CIDR)</label>
<button onclick="loadIPRanges('cloudflare')" class="badge bg-cloudflare border-0 me-1">کلودفلر</button>
<button onclick="loadIPRanges('gcore')" class="badge bg-gcore border-0 me-1">جی‌کور</button>
<button onclick="loadIPRanges('fastly')" class="badge bg-fastly border-0 me-1">فستلی</button>
<textarea id="ipRange" class="form-control" rows="4" placeholder="هر رنج آی پی در یک خط" dir="ltr"></textarea>
<label for="outputCount" class="form-label mt-3">تعداد خروجی‌ها: <span id="outputCountValue">5000</span></label>
<input type="range" class="form-range" min="1000" max="50000" step="1000" id="outputCount" value="5000" oninput="updateOutputCountValue()">
</div>
<div class="col-12 mt-3" id="cidrFields">
<label for="ipRange" class="form-label">IP Ranges (CIDR)</label>
<button onclick="loadIPRanges('cloudflare')" class="badge bg-cloudflare border-0 me-1">Cloudflare</button>
<button onclick="loadIPRanges('gcore')" class="badge bg-gcore border-0 me-1">Gcore</button>
<button onclick="loadIPRanges('fastly')" class="badge bg-fastly border-0 me-1">Fastly</button>
<textarea id="ipRange" class="form-control" rows="4" placeholder="Each IP range on a new line" dir="ltr"></textarea>
<label for="outputCount" class="form-label mt-3">Number of outputs: <span id="outputCountValue">5000</span></label>
<input type="range" class="form-range" min="1000" max="50000" step="1000" id="outputCount" value="5000" oninput="updateOutputCountValue()">
</div>

<div class="col-12 mt-3" id="listFields" style="display: none;">
<label for="ipList" class="form-label">لیست آی پی‌</label>
<textarea id="ipList" class="form-control" rows="8" placeholder="هر آی پی در یک خط" dir="ltr"></textarea>
</div>
<div class="col-12 mt-3" id="listFields" style="display: none;">
<label for="ipList" class="form-label">IP List</label>
<textarea id="ipList" class="form-control" rows="8" placeholder="Each IP on a new line" dir="ltr"></textarea>
</div>

<div class="col-12 mt-4">
<button onclick="generateConfigs()" class="btn btn-primary">تولید کانفیگ‌ها</button>
<button onclick="copyToClipboard()" class="btn btn-secondary px-4" id="copyButton" style="display: none;">کپی</button>
<button onclick="downloadOutput()" class="btn btn-success px-4" id="downloadButton" style="display: none;">دانلود</button>
</div>
<div class="col-12 mt-4">
<button onclick="generateConfigs()" class="btn btn-primary">Generate Configs</button>
<button onclick="copyToClipboard()" class="btn btn-secondary px-4" id="copyButton" style="display: none;">Copy</button>
<button onclick="downloadOutput()" class="btn btn-success px-4" id="downloadButton" style="display: none;">Download</button>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ipaddr.js/2.0.1/ipaddr.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/base64.min.js"></script>
<script src="assets/js/script.js?v=1.0.3"></script>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ipaddr.js/2.0.1/ipaddr.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/base64.min.js"></script>
<script src="assets/js/script.js?v=1.0.4"></script>
</body>
</html>

0 comments on commit 42b3ab4

Please sign in to comment.