---
title: "Excel File Translation."
description: "Smart translation for Excel files, multiple language support, preserve original formatting."

---

# Excel File Translation.


> Smart translation for Excel files, multiple language support, preserve original formatting.





















































```
- 
:root {
--cells-cloud-ai-spreadsheet-primary-color: #4f46e5;
--cells-cloud-ai-spreadsheet-secondary-color: #7c3aed;
--cells-cloud-ai-spreadsheet-accent-color: #06b6d4;
--cells-cloud-ai-spreadsheet-dark-color: #1e293b;
--cells-cloud-ai-spreadsheet-light-color: #f8fafc;
--cells-cloud-ai-spreadsheet-card-bg: rgba(255, 255, 255, 0.95);
--cells-cloud-ai-spreadsheet-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
--cells-cloud-ai-spreadsheet-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.cells-cloud-ai-spreadsheet {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
color: var(--cells-cloud-ai-spreadsheet-dark-color);
line-height: 1.6;
min-height: 100vh;
overflow-x: hidden;
}
.cells-cloud-ai-spreadsheet-container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
.cells-cloud-ai-spreadsheet-page-header {
text-align: center;
margin-bottom: 3rem;
padding-top: 2rem;
}
.cells-cloud-ai-spreadsheet-page-header h1 {
font-size: 2.8rem;
margin-bottom: 1rem;
background: linear-gradient(to right, var(--cells-cloud-ai-spreadsheet-primary-color), var(--cells-cloud-ai-spreadsheet-accent-color));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.cells-cloud-ai-spreadsheet-page-header p {
color: #64748b;
font-size: 1.1rem;
max-width: 600px;
margin: 0 auto;
}
.cells-cloud-ai-spreadsheet-upload-area {
background: var(--cells-cloud-ai-spreadsheet-card-bg);
border-radius: 20px;
padding: 3rem 2rem;
box-shadow: var(--cells-cloud-ai-spreadsheet-shadow);
margin-bottom: 2rem;
text-align: center;
border: 2px dashed rgba(79, 70, 229, 0.2);
transition: var(--cells-cloud-ai-spreadsheet-transition);
position: relative;
overflow: hidden;
}
.cells-cloud-ai-spreadsheet-upload-area:hover {
border-color: var(--cells-cloud-ai-spreadsheet-primary-color);
transform: translateY(-5px);
}
.cells-cloud-ai-spreadsheet-upload-area.drag-over {
border-color: var(--cells-cloud-ai-spreadsheet-accent-color);
background: rgba(79, 70, 229, 0.02);
}
.cells-cloud-ai-spreadsheet-upload-icon {
width: 100px;
height: 100px;
background: linear-gradient(135deg, var(--cells-cloud-ai-spreadsheet-primary-color), var(--cells-cloud-ai-spreadsheet-secondary-color));
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 2rem;
color: white;
font-size: 2.5rem;
box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}
.cells-cloud-ai-spreadsheet-upload-area h2 {
font-size: 1.8rem;
margin-bottom: 1rem;
color: var(--cells-cloud-ai-spreadsheet-dark-color);
}
.cells-cloud-ai-spreadsheet-upload-area p {
color: #64748b;
margin-bottom: 2rem;
font-size: 1rem;
}
.cells-cloud-ai-spreadsheet-file-input {
display: none;
}
.cells-cloud-ai-spreadsheet-file-label {
display: inline-block;
background: linear-gradient(to right, var(--cells-cloud-ai-spreadsheet-primary-color), var(--cells-cloud-ai-spreadsheet-secondary-color));
color: white;
padding: 15px 40px;
border-radius: 50px;
cursor: pointer;
font-weight: 600;
transition: var(--cells-cloud-ai-spreadsheet-transition);
box-shadow: 0 5px 20px rgba(79, 70, 229, 0.3);
}
.cells-cloud-ai-spreadsheet-file-label:hover {
transform: translateY(-3px);
box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}
.cells-cloud-ai-spreadsheet-file-info {
margin-top: 1.5rem;
padding: 1rem;
background: #f8fafc;
border-radius: 10px;
display: none;
text-align: left;
animation: cells-cloud-ai-spreadsheet-fadeIn 0.5s ease;
}
@keyframes cells-cloud-ai-spreadsheet-fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.cells-cloud-ai-spreadsheet-file-info.show {
display: block;
}
.cells-cloud-ai-spreadsheet-file-name {
font-weight: 600;
color: var(--cells-cloud-ai-spreadsheet-dark-color);
margin-bottom: 0.5rem;
}
.cells-cloud-ai-spreadsheet-file-size {
color: #64748b;
font-size: 0.9rem;
}
.cells-cloud-ai-spreadsheet-file-remove {
position: absolute;
top: 1rem;
right: 1rem;
color: #ef4444;
cursor: pointer;
font-size: 1.2rem;
transition: var(--cells-cloud-ai-spreadsheet-transition);
}
.cells-cloud-ai-spreadsheet-file-remove:hover {
transform: scale(1.2);
}
.cells-cloud-ai-spreadsheet-language-section {
background: var(--cells-cloud-ai-spreadsheet-card-bg);
border-radius: 20px;
padding: 2.5rem;
box-shadow: var(--cells-cloud-ai-spreadsheet-shadow);
margin-bottom: 2rem;
}
.cells-cloud-ai-spreadsheet-language-section h2 {
font-size: 1.8rem;
margin-bottom: 1.5rem;
color: var(--cells-cloud-ai-spreadsheet-dark-color);
text-align: center;
}
.cells-cloud-ai-spreadsheet-language-select-wrapper {
position: relative;
max-width: 500px;
margin: 0 auto;
}
.cells-cloud-ai-spreadsheet-language-select {
width: 100%;
padding: 1.2rem 1.5rem;
font-size: 1.1rem;
border: 2px solid #e2e8f0;
border-radius: 12px;
background: white;
color: var(--cells-cloud-ai-spreadsheet-dark-color);
cursor: pointer;
appearance: none;
transition: var(--cells-cloud-ai-spreadsheet-transition);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 1.5rem center;
background-size: 1.2rem;
padding-right: 3.5rem;
}
.cells-cloud-ai-spreadsheet-language-select:focus {
outline: none;
border-color: var(--cells-cloud-ai-spreadsheet-primary-color);
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.cells-cloud-ai-spreadsheet-language-select:hover {
border-color: #cbd5e1;
}
.cells-cloud-ai-spreadsheet-language-option {
display: flex;
align-items: center;
padding: 0.8rem 1rem;
}
.cells-cloud-ai-spreadsheet-language-flag {
width: 24px;
height: 24px;
border-radius: 50%;
overflow: hidden;
margin-right: 0.8rem;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
}
.cells-cloud-ai-spreadsheet-language-name {
font-weight: 500;
color: var(--cells-cloud-ai-spreadsheet-dark-color);
}
.cells-cloud-ai-spreadsheet-language-code {
font-size: 0.85rem;
color: #64748b;
margin-left: 0.5rem;
}
.cells-cloud-ai-spreadsheet-action-section {
text-align: center;
margin-top: 3rem;
margin-bottom: 4rem;
}
.cells-cloud-ai-spreadsheet-translate-btn {
display: inline-flex;
align-items: center;
background: linear-gradient(to right, var(--cells-cloud-ai-spreadsheet-primary-color), var(--cells-cloud-ai-spreadsheet-secondary-color));
color: white;
padding: 18px 50px;
border-radius: 50px;
border: none;
font-size: 1.2rem;
font-weight: 600;
cursor: pointer;
transition: var(--cells-cloud-ai-spreadsheet-transition);
box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
position: relative;
overflow: hidden;
}
.cells-cloud-ai-spreadsheet-translate-btn::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: 0.5s;
}
.cells-cloud-ai-spreadsheet-translate-btn:hover {
transform: translateY(-5px);
box-shadow: 0 15px 40px rgba(79, 70, 229, 0.4);
}
.cells-cloud-ai-spreadsheet-translate-btn:hover::before {
left: 100%;
}
.cells-cloud-ai-spreadsheet-translate-btn i {
margin-right: 12px;
font-size: 1.3rem;
transition: var(--cells-cloud-ai-spreadsheet-transition);
}
.cells-cloud-ai-spreadsheet-translate-btn:hover i {
transform: rotate(10deg);
}
.cells-cloud-ai-spreadsheet-translate-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none !important;
}
.cells-cloud-ai-spreadsheet-progress {
margin-top: 2rem;
display: none;
}
.cells-cloud-ai-spreadsheet-progress-bar {
width: 100%;
height: 8px;
background: #e2e8f0;
border-radius: 4px;
overflow: hidden;
margin-bottom: 1rem;
}
.cells-cloud-ai-spreadsheet-progress-fill {
width: 0%;
height: 100%;
background: linear-gradient(to right, var(--cells-cloud-ai-spreadsheet-primary-color), var(--cells-cloud-ai-spreadsheet-accent-color));
border-radius: 4px;
transition: width 0.3s ease;
}
.cells-cloud-ai-spreadsheet-progress-text {
text-align: center;
color: #64748b;
font-size: 0.9rem;
}
.cells-cloud-ai-spreadsheet-result-section {
background: var(--cells-cloud-ai-spreadsheet-card-bg);
border-radius: 20px;
padding: 2.5rem;
box-shadow: var(--cells-cloud-ai-spreadsheet-shadow);
margin-top: 2rem;
display: none;
animation: cells-cloud-ai-spreadsheet-fadeIn 0.5s ease;
text-align: center;
}
.cells-cloud-ai-spreadsheet-result-section.show {
display: block;
}
.cells-cloud-ai-spreadsheet-result-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
}
.cells-cloud-ai-spreadsheet-result-header h2 {
font-size: 1.8rem;
color: var(--cells-cloud-ai-spreadsheet-dark-color);
margin: 0;
}
.cells-cloud-ai-spreadsheet-download-btn {
display: inline-flex;
align-items: center;
background: linear-gradient(to right, #10b981, #34d399);
color: white;
padding: 15px 40px;
border-radius: 50px;
text-decoration: none;
font-weight: 600;
transition: var(--cells-cloud-ai-spreadsheet-transition);
box-shadow: 0 5px 20px rgba(16, 185, 129, 0.3);
}
.cells-cloud-ai-spreadsheet-download-btn:hover {
transform: translateY(-3px);
box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}
.cells-cloud-ai-spreadsheet-download-btn i {
margin-right: 10px;
}
.cells-cloud-ai-spreadsheet-features {
margin-top: 4rem;
}
.cells-cloud-ai-spreadsheet-features h2 {
text-align: center;
font-size: 2rem;
margin-bottom: 2rem;
color: var(--cells-cloud-ai-spreadsheet-dark-color);
}
.cells-cloud-ai-spreadsheet-feature-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
}
.cells-cloud-ai-spreadsheet-feature-item {
background: var(--cells-cloud-ai-spreadsheet-card-bg);
padding: 1.5rem;
border-radius: 15px;
box-shadow: var(--cells-cloud-ai-spreadsheet-shadow);
transition: var(--cells-cloud-ai-spreadsheet-transition);
}
.cells-cloud-ai-spreadsheet-feature-item:hover {
transform: translateY(-5px);
}
.cells-cloud-ai-spreadsheet-feature-item i {
font-size: 2rem;
color: var(--cells-cloud-ai-spreadsheet-primary-color);
margin-bottom: 1rem;
}
.cells-cloud-ai-spreadsheet-feature-item h3 {
font-size: 1.2rem;
margin-bottom: 0.5rem;
color: var(--cells-cloud-ai-spreadsheet-dark-color);
}
.cells-cloud-ai-spreadsheet-feature-item p {
color: #64748b;
font-size: 0.9rem;
}
@media (max-width: 768px) {
.cells-cloud-ai-spreadsheet-container {
padding: 1rem;
}
.cells-cloud-ai-spreadsheet-page-header h1 {
font-size: 2rem;
}
.cells-cloud-ai-spreadsheet-upload-area {
padding: 2rem 1rem;
}
.cells-cloud-ai-spreadsheet-upload-icon {
width: 80px;
height: 80px;
font-size: 2rem;
}
.cells-cloud-ai-spreadsheet-language-select-wrapper {
max-width: 100%;
}
.cells-cloud-ai-spreadsheet-result-header {
flex-direction: column;
gap: 1.5rem;
text-align: center;
}
}
# Excel File Translation
Smart translation for Excel files, multiple language support, preserve original formatting
## Upload Excel File
Supports .xlsx, .xls formats
Select File
Or drag and drop file here
## Select Target Language
Select target language...
Start Translation
Preparing translation...
## Translation Complete
Download File
Translate New File
## Features
### Format Preserved
Keep original Excel formatting, formulas and styles
### Multi-language
Support 20+ commonly used languages
### Fast Processing
AI-powered translation engine for large data
const languages = [
{ code: 'en', name: 'English', flag: '🇺🇸' },
{ code: 'zh', name: 'Chinese', flag: '🇨🇳' },
{ code: 'es', name: 'Spanish', flag: '🇪🇸' },
{ code: 'fr', name: 'French', flag: '🇫🇷' },
{ code: 'de', name: 'German', flag: '🇩🇪' },
{ code: 'ja', name: 'Japanese', flag: '🇯🇵' },
{ code: 'ko', name: 'Korean', flag: '🇰🇷' },
{ code: 'ru', name: 'Russian', flag: '🇷🇺' },
{ code: 'pt', name: 'Portuguese', flag: '🇵🇹' },
{ code: 'it', name: 'Italian', flag: '🇮🇹' },
{ code: 'ar', name: 'Arabic', flag: '🇸🇦' },
{ code: 'nl', name: 'Dutch', flag: '🇳🇱' },
{ code: 'tr', name: 'Turkish', flag: '🇹🇷' },
{ code: 'pl', name: 'Polish', flag: '🇵🇱' },
{ code: 'sv', name: 'Swedish', flag: '🇸🇪' },
{ code: 'da', name: 'Danish', flag: '🇩🇰' },
{ code: 'fi', name: 'Finnish', flag: '🇫🇮' },
{ code: 'no', name: 'Norwegian', flag: '🇳🇴' },
{ code: 'hi', name: 'Hindi', flag: '🇮🇳' },
{ code: 'vi', name: 'Vietnamese', flag: '🇻🇳' }
];
const API_ENDPOINT = 'https://cells-scripting-api.aspose.cloud/v4.0/cells/runwebapi';
const TRANSLATE_ENDPOINT = 'https://api.aspose.cloud/v4.0/cells/ai/translate/spreadsheet';
document.addEventListener('DOMContentLoaded', function() {
const uploadArea = document.getElementById('uploadArea');
const fileInput = document.getElementById('excelFile');
const fileInfo = document.getElementById('fileInfo');
const fileName = document.getElementById('fileName');
const fileSize = document.getElementById('fileSize');
const removeFile = document.getElementById('removeFile');
const languageSelect = document.getElementById('languageSelect');
const translateBtn = document.getElementById('translateBtn');
const progress = document.getElementById('progress');
const progressFill = document.getElementById('progressFill');
const progressText = document.getElementById('progressText');
const resultSection = document.getElementById('resultSection');
const downloadBtn = document.getElementById('downloadBtn');
let selectedFile = null;
let selectedLanguage = null;
let translatedFileBlob = null;
function initLanguageSelect() {
languages.forEach(lang => {
const option = document.createElement('option');
option.value = lang.code;
option.textContent = `${lang.flag} ${lang.name} (${lang.code.toUpperCase()})`;
languageSelect.appendChild(option);
});
}
languageSelect.addEventListener('change', function() {
selectedLanguage = this.value;
updateTranslateButton();
});
function updateTranslateButton() {
translateBtn.disabled = !(selectedFile && selectedLanguage);
}
fileInput.addEventListener('change', handleFileSelect);
uploadArea.addEventListener('dragover', function(e) {
e.preventDefault();
uploadArea.classList.add('drag-over');
});
uploadArea.addEventListener('dragleave', function() {
uploadArea.classList.remove('drag-over');
});
uploadArea.addEventListener('drop', function(e) {
e.preventDefault();
uploadArea.classList.remove('drag-over');
if (e.dataTransfer.files.length) {
handleFile(e.dataTransfer.files[0]);
}
});
function handleFileSelect(e) {
if (e.target.files.length) {
handleFile(e.target.files[0]);
}
}
function handleFile(file) {
const validTypes = ['.xlsx', '.xls', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel'];
const fileExtension = file.name.slice(file.name.lastIndexOf('.')).toLowerCase();
const isValidType = validTypes.includes(fileExtension) ||
validTypes.includes(file.type);
if (!isValidType) {
alert('Please select Excel file (.xlsx or .xls format)');
fileInput.value = '';
return;
}
selectedFile = file;
fileName.textContent = file.name;
fileSize.textContent = formatFileSize(file.size);
fileInfo.classList.add('show');
updateTranslateButton();
}
removeFile.addEventListener('click', function() {
selectedFile = null;
fileInput.value = '';
fileInfo.classList.remove('show');
updateTranslateButton();
});
function formatFileSize(bytes) {
if (bytes === 0) return '0 Bytes';
const k = 1024;
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
}
function updateProgress(value, text) {
progressFill.style.width = value + '%';
progressText.textContent = text;
}
translateBtn.addEventListener('click', async function() {
if (!selectedFile || !selectedLanguage) return;
progress.style.display = 'block';
translateBtn.disabled = true;
updateProgress(10, 'Preparing file for translation...');
try {
await translateExcelFile();
} catch (error) {
console.error('Translation error:', error);
progressText.textContent = 'Translation failed: ' + error.message;
translateBtn.disabled = false;
setTimeout(() => {
progress.style.display = 'none';
}, 3000);
}
});
async function translateExcelFile() {
updateProgress(20, 'Uploading file to server...');
const formData = new FormData();
const translateUrl = `${TRANSLATE_ENDPOINT}?targetLanguage=${selectedLanguage}`;
formData.append("url", translateUrl);
formData.append("method", "PUT");
formData.append("files", selectedFile);
updateProgress(40, 'Sending translation request...');
try {
const response = await fetch(API_ENDPOINT, {
method: 'POST',
body: formData
});
updateProgress(70, 'Processing translation...');
if (!response.ok) {
let errorMessage = `API request failed with status ${response.status}`;
try {
const errorText = await response.text();
if (errorText) {
const errorJson = JSON.parse(errorText);
errorMessage = errorJson.Message || errorJson.message || errorMessage;
}
} catch (e) {
}
throw new Error(errorMessage);
}
const contentType = response.headers.get('content-type');
if (contentType && contentType.includes('application/json')) {
const result = await response.json();
if (result && result.Status && result.Status !== 'OK') {
throw new Error(result.Message || 'Translation failed');
}
if (result && result.Content) {
await handleJsonResponseWithContent(result);
} else {
throw new Error('Invalid response format');
}
} else if (contentType && (
contentType.includes('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') ||
contentType.includes('application/vnd.ms-excel') ||
contentType.includes('application/octet-stream')
)) {
await handleBinaryResponse(response);
} else {
await handleBinaryResponse(response);
}
} catch (error) {
throw new Error(`Translation process failed: ${error.message}`);
}
}
async function handleBinaryResponse(response) {
updateProgress(90, 'Downloading translated file...');
translatedFileBlob = await response.blob();
if (!translatedFileBlob || translatedFileBlob.size === 0) {
throw new Error('Received empty file');
}
const originalName = selectedFile.name;
const nameWithoutExt = originalName.lastIndexOf('.') > 0
? originalName.substring(0, originalName.lastIndexOf('.'))
: originalName;
const extension = originalName.lastIndexOf('.') > 0
? originalName.substring(originalName.lastIndexOf('.'))
: '.xlsx';
const translatedFileName = `${nameWithoutExt}_${selectedLanguage}${extension}`;
const blobUrl = URL.createObjectURL(translatedFileBlob);
downloadBtn.href = blobUrl;
downloadBtn.download = translatedFileName;
await handleTranslationSuccess();
}
async function handleJsonResponseWithContent(result) {
updateProgress(90, 'Creating translated file...');
if (result.Content) {
try {
const binaryString = atob(result.Content);
const bytes = new Uint8Array(binaryString.length);
for (let i = 0; i 0
? originalName.substring(0, originalName.lastIndexOf('.'))
: originalName;
const extension = originalName.lastIndexOf('.') > 0
? originalName.substring(originalName.lastIndexOf('.'))
: '.xlsx';
const translatedFileName = `${nameWithoutExt}_${selectedLanguage}${extension}`;
const blobUrl = URL.createObjectURL(translatedFileBlob);
downloadBtn.href = blobUrl;
downloadBtn.download = translatedFileName;
await handleTranslationSuccess();
} catch (e) {
throw new Error('Failed to decode file content');
}
} else {
throw new Error('No file content in response');
}
}
async function handleTranslationSuccess() {
updateProgress(100, 'Translation complete!');
await new Promise(resolve => setTimeout(resolve, 800));
progress.style.display = 'none';
resultSection.classList.add('show');
setTimeout(() => {
resultSection.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}, 100);
downloadBtn.onclick = function(e) {
if (!translatedFileBlob) {
e.preventDefault();
alert('File is not ready for download. Please try again.');
return;
}
if (downloadBtn.href && downloadBtn.href.startsWith('blob:')) {
setTimeout(() => {
URL.revokeObjectURL(downloadBtn.href);
}, 100);
}
};
}
window.addEventListener('beforeunload', function() {
if (downloadBtn.href && downloadBtn.href.startsWith('blob:')) {
URL.revokeObjectURL(downloadBtn.href);
}
});
initLanguageSelect();
});
```



