[gnome-maps/wip/mlundblad/es6-modules] wikipedia: Use string templates instead of imports.format
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/es6-modules] wikipedia: Use string templates instead of imports.format
- Date: Mon, 23 May 2022 21:17:13 +0000 (UTC)
commit c1d7bb6662e683ae55bd30e02751b598ec83747e
Author: Marcus Lundblad <ml dfupdate se>
Date: Mon May 23 23:16:24 2022 +0200
wikipedia: Use string templates instead of imports.format
imports.format is deprecated. Use ES string templates instead.
src/wikipedia.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/wikipedia.js b/src/wikipedia.js
index 4629d06d..c8dd556d 100644
--- a/src/wikipedia.js
+++ b/src/wikipedia.js
@@ -24,7 +24,6 @@ import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Soup from 'gi://Soup';
-const Format = imports.format;
import * as Utils from './utils.js';
/**
@@ -89,7 +88,7 @@ export function isValidWikipedia(wiki) {
export function fetchArticleInfo(wiki, size, metadataCb, thumbnailCb) {
let lang = getLanguage(wiki);
let title = getHtmlEntityEncodedArticle(wiki);
- let uri = Format.vprintf('https://%s.wikipedia.org/w/api.php', [ lang ]);
+ let uri = `https://${lang}.wikipedia.org/w/api.php`;
let msg = Soup.form_request_new_from_hash('GET', uri, { action: 'query',
titles: title,
prop: 'extracts|pageimages|langlinks',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]