Skip to content

Commit c99f50e

Browse files
committed
Update NVFP4 blog to support multilingual content
- Modified the fetching logic to dynamically select the markdown file based on the selected language (English or Chinese). - Ensured that the correct content is loaded for improved accessibility and user experience.
1 parent 3d8a6ba commit c99f50e

File tree

1 file changed

+8
-2
lines changed
  • app/blog/pretrain-llm-with-nvfp4

1 file changed

+8
-2
lines changed

app/blog/pretrain-llm-with-nvfp4/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export default function NVFP4Project() {
2121
useEffect(() => {
2222
const fetchMarkdownContent = async () => {
2323
try {
24-
const response = await fetch(`/content/pretrain-llm-with-nvfp4/pretrain-llms-with-fp4-content.md`);
24+
const filename = language === 'zh'
25+
? 'pretrain-llms-with-fp4-content-zh.md'
26+
: 'pretrain-llms-with-fp4-content.md';
27+
const response = await fetch(`/content/pretrain-llm-with-nvfp4/${filename}`);
2528
const content = await response.text();
2629

2730
// Parse frontmatter
@@ -101,7 +104,10 @@ export default function NVFP4Project() {
101104
const handleCopyArticle = async () => {
102105
try {
103106
// Get the raw markdown content without frontmatter
104-
const response = await fetch(`/content/pretrain-llm-with-nvfp4/pretrain-llms-with-fp4-content.md`);
107+
const filename = language === 'zh'
108+
? 'pretrain-llms-with-fp4-content-zh.md'
109+
: 'pretrain-llms-with-fp4-content.md';
110+
const response = await fetch(`/content/pretrain-llm-with-nvfp4/${filename}`);
105111
const content = await response.text();
106112

107113
// Remove frontmatter if present

0 commit comments

Comments
 (0)