[gnome-maps/wip/mlundblad/es6-modules: 9/22] 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: 9/22] wikipedia: Use string templates instead of imports.format
- Date: Sun, 29 May 2022 20:47:38 +0000 (UTC)
commit ab86f5a0f76c3f56b1e1b76b5bdbc2ab791429d3
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]